Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default colors of lines

Status
Not open for further replies.

wdmax

Automotive
Oct 15, 2004
8
Hi all

Now i met with a (maybe quite easy)problem.I am doing comparations between two generated lines with command "plot".The only problem is that everytime i got two lines with colors blue and green.Sometimes i am suffering to tell the little differences between the two lines.It really takes trouble for my eyes.i failed to find the way to change the default colors of lines in the figure.

has anyone an idea?please help me!

Thanks!

Regards
 
Replies continue below

Recommended for you

The third parameter to the plot-command is the color parameter.
Code:
plot(x,y,'r')  % plot red line

There are a number of predefined colors
r - Red
g - Green
b - Blue
c - Cyan
m - Magenta
y - Yellow
k - Black
w - White

You can also define the color using a RGB-vector with element values between 0 and 1
Code:
plot(x,y,'Color',[0 0 1])  % plot blue line
 
Change one of the line types. Type 'help plot' and you'll get all the info you need to change color, linetype, etc.

For example:

plot(t, y1, t, y2, 'k:') plots line y1 as blue, continuous (default, since no option selected), whereas line y2 is plotted as a black dotted line due to the 'k:' option.

xnuke

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor