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:
How to reverse the color order in colorbar

Subject: How to reverse the color order in colorbar

From: Shaddy

Date: 19 Nov, 2009 15:11:06

Message: 1 of 2

I am ploting my matrix A in the folowing way:

imagesc(A)
colormap(gray(82))
colorbar
caxis([-.15 0.15])

This way the I will have -.15 in black and +.15 in white, how ca I reverse this order such that I will have -.15 in white and +.15 in black?

Thank you

Subject: How to reverse the color order in colorbar

From: Wolfgang Schwanghart

Date: 19 Nov, 2009 15:42:18

Message: 2 of 2

"Shaddy " <shaddyab@gmail.com> wrote in message <he3n6a$e3i$1@fred.mathworks.com>...
> I am ploting my matrix A in the folowing way:
>
> imagesc(A)
> colormap(gray(82))
> colorbar
> caxis([-.15 0.15])
>
> This way the I will have -.15 in black and +.15 in white, how ca I reverse this order such that I will have -.15 in white and +.15 in black?
>
> Thank you

Hi Shaddy,

imagesc(A)
colormap(flipud(gray(82)))
colorbar
caxis([-.15 0.15])

Best regards,
W.

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