Change colours of specific points in a scatter plot that has already been plotted?
Show older comments
I have a dimensionality reduction algorithm that extracts latent variables from a dataset and visualises one latent variable with three subplots. The third of the three subplots is a scatter plot, and I want to change the colours of some of the points in this scatter plot.
I know what the indexes of the points that I want to change the colour of are, but I cannot just plot one set one colour and then another set another colour, because the plots are generated from a 3rd order tensor, and are not just datapoints.
Hence I ask: is it possible for me to change colours the datapoints in the plot, after they have been plotted?
5 Comments
KSSV
on 17 Aug 2020
If you have indices.....using the indices specify your required color using plot command.
David Haydock
on 17 Aug 2020
Do you know these indices a priori or only after the plot already done and then they're somehow determined?
If you know them at the time the plot(), use scatter() and a color vector of the length of the variable...if you use plot(), then all elements in one call are the same line and ergo have the same linestyle and color so can't change them individually.
I don't understand the part about the tensor; you've got to get the coordinates for plotting at some point, so why can't those be saved and plotted as wanted at will?
David Haydock
on 17 Aug 2020
David Haydock
on 17 Aug 2020
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!