I am trying to make a scatterplot where there exist two groups, one called “0” and one called “1”. The group values is stored in a vector “z”. Over time the points in group “0”, come to group “1”, something like this:
But in the final time step, when all have come to group “1”, the color just becomes “blue” - I want it to stay orange or some other color I set:
How do I achieve this, using Plots? My current command is:
p = scatter((data[1,:],data[2,:]),
group = z,
markersize = 3.5,
markerstrokestyle = :dot,
aspect_ratio=:equal
);
The easiest solution here is to pull a slight of hand and make the orange group 0 and the blue group 1, then use the labels option to change your legend and the colors option to change the colors.
To do this I would need to split my data some way, and I am not sure how to do it correctly in Julia. In Matlab I would use “~” to get reverse indices, i.e. if I have a vector of 0 and 1, then using “~”, I could switch it to 1 and 0 - hope it makes sense.