MATLAB: How to plot a line of a certain color

colorcolorcodeMATLABplotrgb

I have 7 lines on a single plot. I dont want to use the 'y' color code. How can I make my own color? I also want this line to have asterisks along it. So currently I have 'y*-' but again I dont want to use yellow

Best Answer

plot(x,y,'*','color','blue') plots in blue. plot(x,y,'*','color',[.5 .4 .7]) plots the RGB value [.5 .4 .7]. If you want lots of color names, you could use the rgb function to return the RGB values of just about any color. For example, plot(x,y,'*','color',rgb('blood red'))