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

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
colorbar Shaddy 19 Nov, 2009 10:14:04
rssFeed for this Thread

Contact us at files@mathworks.com