I am trying to make a plot of 3 properties of chemical elements. I would like the first property on the x-axis, the second on the y-axis, and the third presented by the color of the plot points. Using 'scatter' to do this is trivial, e.g.:
x=1:10;y=1:10;c=1:10;figurexlim([0 11]);ylim([0 11])scatter(x,y,50,c,'.')colorbar
However, I would like the graph to plot the abbreviation for the chemical in question, rather than a standard matlab symbol…
I can do this using the 'text' command:
x=1:10;y=1:10;chem={'H','He','Li','Be','B','C','N','O','F','Ne'};figurexlim([0 11]);ylim([0 11])text(x,y,chem)
But I want to color the text labels to correspond to a colorbar representing my third parameter, as they are in the scatter plot.
I cannot find a way to do this – any ideas?
Thanks in advance!
Best Answer