how to get more colors?

Hai,
I have used all the colors viz. 'y','m','c','r','g','b','w' and 'k' in matlab to draw lines. I need to draw some more lines with different colors, other than the above colors. How could I get more colors to draw lines? Looking for your reply.
BSD

3 Comments

You do not have to choose colors randomly. Use any graphics software (like Paint) and use the color editor to find a color you want. Divide the resulting RGB numbers by 255 to get a number between 0 and 1. Example:
plot(x,y,'Color',[.61 .51 .74]) % makes a pretty purple
So helpful, thank you!
FYI the uisetcolor tool in MATLAB will allow you to select a color interactively and return the RGB value you can use to set the 'Color' property of a graphics object.

Sign in to comment.

 Accepted Answer

joeDiHare
joeDiHare on 10 Oct 2011

9 votes

You can use the option 'Color' and then chosing any combination of randon numbers (between 0 and 1) which form a triplet, e.g. [0.1 0.3 0.5]. This will give a combination of saturation for Red, Green and Blue, that as you may know, can be combined to give almost any color (RGB system).
syntax would be plot(t,x,'Color',[rand rand rand])
Stefano

More Answers (1)

Walter Roberson
Walter Roberson on 21 Jan 2014

1 vote

Consider using the File Exchange contribution "plt"

Categories

Find more on Graphics Performance in Help Center and File Exchange

Tags

Asked:

bsd
on 10 Oct 2011

Commented:

on 5 May 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!