Thread Subject: define color

Subject: define color

From: Juliette Salexa

Date: 21 Jun, 2009 04:57:01

Message: 1 of 5

How do I define custom colors in matlab ??
The documentation for the color commands are almost useless ..
I've tried: set(grey,'Color',[0.4,0.4,0.4]) but when I put 'grey' in my plot options, my lines are not grey.

Subject: define color

From: Bruno Luong

Date: 21 Jun, 2009 08:04:01

Message: 2 of 5

"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h1keit$kra$1@fred.mathworks.com>...
> How do I define custom colors in matlab ??
> The documentation for the color commands are almost useless ..
> I've tried: set(grey,'Color',[0.4,0.4,0.4]) but when I put 'grey' in my plot options, my lines are not grey.

Uhhh, why not

grey = [0.4,0.4,0.4];
plot(x,y,grey)

Bruno

Subject: define color

From: Juliette Salexa

Date: 21 Jun, 2009 12:44:01

Message: 3 of 5

It doesn't work for me:

>> x=1:10;
>> y=x*2;
>> grey=[0.4,0.4,0.4];
>> plot(x,y,grey);
??? Error using ==> plot
Data must be a single matrix Y or a list of pairs X,Y

>> plot(x,y,'grey');
??? Error using ==> plot
Error in color/linetype argument

----------------------------------------------------

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h1kphh$5gu$1@fred.mathworks.com>...
> "Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h1keit$kra$1@fred.mathworks.com>...
> > How do I define custom colors in matlab ??
> > The documentation for the color commands are almost useless ..
> > I've tried: set(grey,'Color',[0.4,0.4,0.4]) but when I put 'grey' in my plot options, my lines are not grey.
>
> Uhhh, why not
>
> grey = [0.4,0.4,0.4];
> plot(x,y,grey)
>
> Bruno

Subject: define color

From: Bruno Luong

Date: 21 Jun, 2009 12:54:01

Message: 4 of 5

"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h1l9uh$n8g$1@fred.mathworks.com>...
> It doesn't work for me:
>
> >> x=1:10;
> >> y=x*2;
> >> grey=[0.4,0.4,0.4];
> >> plot(x,y,grey);

Opps, try to replace the plot command by

plot(x,y,'Color',grey);

% Bruno

Subject: define color

From: Juliette Salexa

Date: 22 Jun, 2009 03:17:01

Message: 5 of 5

Perfect! Thanks so much!

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h1lah9$bt$1@fred.mathworks.com>...
> "Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h1l9uh$n8g$1@fred.mathworks.com>...
> > It doesn't work for me:
> >
> > >> x=1:10;
> > >> y=x*2;
> > >> grey=[0.4,0.4,0.4];
> > >> plot(x,y,grey);
>
> Opps, try to replace the plot command by
>
> plot(x,y,'Color',grey);
>
> % Bruno

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
define color Sprinceana 22 Jun, 2009 04:21:24
color Sprinceana 22 Jun, 2009 04:21:24
rssFeed for this Thread

Contact us at files@mathworks.com