Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Plotting points in orange

6,936 views
Skip to first unread message

Joseph Staggs

unread,
Sep 8, 2010, 5:30:27 PM9/8/10
to
I have searched the help file, and I can only figure out how to plot a point in the following colors: Red, Green, Blue, Cyan, Magenta, Yellow, Black, and White. I know that you use the command plot(x,y,'g.') to plot a point/points in green, for example. Can anyone tell me how to get orange?

Walter Roberson

unread,
Sep 8, 2010, 5:56:57 PM9/8/10
to

There is no color code for orange. You will have to code it as an RGB
triple.

Mark Shore

unread,
Sep 8, 2010, 8:03:05 PM9/8/10
to
Walter Roberson <robe...@hushmail.com> wrote in message <JETho.54098$1v3....@newsfe20.iad>...

Thanks for the comment - this has been bugging me too but never quite enough to read through the plotting help files.

So a quick modification of the help example gives orange circles with a black boundary:

plot(somevector,'-ko',...
'LineWidth',1,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[1 .5 0],...
'MarkerSize',8)

Joseph Staggs

unread,
Sep 8, 2010, 10:27:23 PM9/8/10
to
Walter Roberson <robe...@hushmail.com> wrote in message <JETho.54098$1v3....@newsfe20.iad>...

Joseph Staggs

unread,
Sep 8, 2010, 10:29:09 PM9/8/10
to
Walter Roberson <robe...@hushmail.com> wrote in message <JETho.54098$1v3....@newsfe20.iad>...

I have tried doing this, but when plotting points, it wont' let me do this. For example, if i try to do the command plot(x,y,'b.') that will plot points in blue. But if i do plot(x,y,'[.5 .5 .5].') it will not work that way. How would i code it in RGB correctly?

Matt Fig

unread,
Sep 8, 2010, 10:37:23 PM9/8/10
to
No quotes, when giving numerical values.
plot(x,y,'color',[.5 .5 .5]) % plots a grey line.

One thing I did, which you may find useful, is to define color functions. For example, orange.m:


function [C] = orange()
C = [1 .5 0];


Now at the command line:

plot(x,y,'color',orange)

One could define as many such functions as needed.

Joseph Staggs

unread,
Sep 8, 2010, 11:10:19 PM9/8/10
to
"Matt Fig" <spam...@yahoo.com> wrote in message <i69h93$mcg$1...@fred.mathworks.com>...
I figured it out, thanks.

Joshua Carmichael

unread,
Dec 17, 2012, 2:36:10 PM12/17/12
to
I have found that orange is well described by these two number codes:
[1.0,0.687,0.387]; %light orange
[1.0,0.4,0.0]; %dark orange

someone

unread,
Dec 17, 2012, 2:52:08 PM12/17/12
to
"Joseph Staggs" <jst...@utk.edu> wrote in message <i69gpl$lq3$1...@fred.mathworks.com>...
Change:
plot(x,y,'[.5 .5 .5].')
To:
plot(x,y,[.5 .5 .5])
0 new messages