Hello, I have data (see attached figure) which is grouped together by colour. I would like to have a legend that which explains what each colour grouping is defined by. I can only find legend creation questions about creating legends on the actual x-axis data, instead of the colour by which I organized it.
Is there a way to do this? I organized my data by colour as follows:
for i = 1:length(Names) switch Names(i) case{'Pu','Am','Np','Cm'} Yield.CData(i,:) = [255 0 0]; case{'Mo','Ru','Tc','Rh','Zn','Ga'} Yield.CData(i,:) = [0 255 0]; case{'Ce','Nd','Eu','Sm','Sc','Y','La'} Yield.CData(i,:) = [255 255 0]; case{'Li','Na','K','Rb','Cs','Fr'} Yield.CData(i,:) = [0 0 0]; case{'O','Xe','Te'} Yield.CData(i,:) = [255 255 255]; endend
If someone could provide an answer or some insight I would greatly appreicate it.
~ Dan
Best Answer