Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
colorscale for pcolor

Subject: colorscale for pcolor

From: edward kabanyas

Date: 12 Jun, 2009 12:22:01

Message: 1 of 4

hi all !

I have problem to use colorscale.m that proposed by Rob Comer to be used to
increase the number of scale of colorbar. I have the following matlab code
to plot my data:

pcolor(x,k,Zinv2)
shading flat
colorbar;
shading('interp')

Note: Zinv2 max = 0.4 and min 1.04

From Default matlab contour, the scale of
colorbar (default) is about 0.1 and I can not see the chractersitics of
the plot, because most of all are red. So I plan to increase the number
of scale (color) of colorbar with the scale for example 0.05, how can I
do ?

Thanks very nice for your help.

Edward

Subject: colorscale for pcolor

From: Steven Lord

Date: 12 Jun, 2009 13:15:12

Message: 2 of 4


"edward kabanyas" <djuky_hmi@yahoo.com> wrote in message
news:h0th99$9bv$1@fred.mathworks.com...
> hi all !
>
> I have problem to use colorscale.m that proposed by Rob Comer to be used
> to
> increase the number of scale of colorbar. I have the following matlab code
> to plot my data:
>
> pcolor(x,k,Zinv2)
> shading flat
> colorbar;
> shading('interp')
>
> Note: Zinv2 max = 0.4 and min 1.04
>
> From Default matlab contour, the scale of
> colorbar (default) is about 0.1 and I can not see the chractersitics of
> the plot, because most of all are red. So I plan to increase the number
> of scale (color) of colorbar with the scale for example 0.05, how can I
> do ?

Do you want to change the granularity of the colorbar or just the limits?
In the former case, try making the colormap larger (so if it was a 64-by-3
matrix you could make it 128-by-3.) In the latter case, look at the CLim
property of the axes.

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/bqsxy8a-1.html

--
Steve Lord
slord@mathworks.com

Subject: colorscale for pcolor

From: edward kabanyas

Date: 12 Jun, 2009 13:48:02

Message: 3 of 4

Hi Steve;

thank you for comment.

I want to change the granularity of the colorbar (increase the number of color tick)

> In the former case, try making the colormap larger
I don't understand what you mean. For examle for pcolor(x,k,Zinv2), the matrix of the data is:
x = 69 x 1
k = 50 x 1
Zinv2 = 50 x 69

By default color bar, I have 7 thick of colorbar started from 0.4 to 1 with interval 0.1. Now I want to change the tick scale to be 0.05 and of course the granularity also increase.

Again, thanks for nice help.

Edward


> Do you want to change the granularity of the colorbar or just the limits?
> In the former case, try making the colormap larger (so if it was a 64-by-3
> matrix you could make it 128-by-3.) In the latter case, look at the CLim
> property of the axes.
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/bqsxy8a-1.html
>
> --
> Steve Lord
> slord@mathworks.com
>

Subject: colorscale for pcolor

From: Yuji Zhang

Date: 31 Aug, 2013 12:38:10

Message: 4 of 4

Hi Edward~

I had the same problem. I researched and found your post. I just figured it out (I think so). Here's how to deal with it:

colormap(jet(100));

jet means the colormap - you can use others (hot, gray, ...). 100 means 100 levels.

hope this helps~

(I'm wondering, why by default you only have 7 level. I have a few tens of levels by default...)

yuji


"edward kabanyas" <djuky_hmi@yahoo.com> wrote in message <h0tmah$9mk$1@fred.mathworks.com>...
> Hi Steve;
>
> thank you for comment.
>
> I want to change the granularity of the colorbar (increase the number of color tick)
>
> > In the former case, try making the colormap larger
> I don't understand what you mean. For examle for pcolor(x,k,Zinv2), the matrix of the data is:
> x = 69 x 1
> k = 50 x 1
> Zinv2 = 50 x 69
>
> By default color bar, I have 7 thick of colorbar started from 0.4 to 1 with interval 0.1. Now I want to change the tick scale to be 0.05 and of course the granularity also increase.
>
> Again, thanks for nice help.
>
> Edward
>
>
> > Do you want to change the granularity of the colorbar or just the limits?
> > In the former case, try making the colormap larger (so if it was a 64-by-3
> > matrix you could make it 128-by-3.) In the latter case, look at the CLim
> > property of the axes.
> >
> > http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/bqsxy8a-1.html
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> >

Tags for this Thread

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.

Contact us