I’m plotting two vectors against one another. I would like to vary the symbol used to plot each point based on the corresponding value in a third vector.
In other words, if I’m plotting X and Y, I know I can make each plot point display as ‘*’ like so:
plot (X, Y, "*")
But how can I involve a third vector Z such that ‘*’ is displayed for some values of Z, and ‘+’ is displayed for others?
Try something like this:
This essentially makes
nplots, wherenis the length ofxandy. If you want the point color to change for each point you can usehold allinstead ofhold on. If you want the point style to be conditional on the value ofy, you can do