Why is the autocolor green of plot not the same as plotting 'g'?

2 次查看(过去 30 天)
Why don't
plot(x1,y1,x2,y2)
and
plot(x1,y1,'b',x2,y2,'g')
have the same color green line? Can you make them the same color? All the other colors that can be specified as a character seem to produce the same color as the autocolor of plot().

采纳的回答

Tom
Tom 2012-7-11
I have no idea why, but you can set the colour manually:
plot(x,y,'color',[0 0.5 0])
or, for that matter, use any 1x3 vector to set the RGB colours. Type
get(gcf,'DefaultAxesColorOrder')
to see the default colour scheme
  1 个评论
John Petersen
John Petersen 2012-7-11
编辑:John Petersen 2012-7-11
Thanks!
What about a second line such as
plot(x,y,'color',[0 0.5 0], x, y1,'color',[0.5 0 0] )
which gives an error. Do you have to plot them separately to specify special colors? Plotting separately is slower and I scan through many plots until I see something I want to examine, so speed is important.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by