4.25

4.2 | 8 ratings Rate this file 20 Downloads (last 30 days) File Size: 1.86 KB File ID: #4058
image thumbnail

bluewhitered

by Nathan Childress

 

12 Oct 2003 (Updated 14 Oct 2003)

Blue, white, and red colormap for images with positive and negative values.

| Watch this File

File Information
Description

BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white to red colormap, with white corresponding to the CAXIS value closest to zero. This colormap is most useful for images and surface plots with positive and negative values. BLUEWHITERED, by itself, is the same length as the current colormap.

Examples:
------------------------------
figure
imagesc(peaks(250));
colormap(bluewhitered(256)), colorbar

figure
imagesc(peaks(250), [0 8])
colormap(bluewhitered), colorbar
 
figure
imagesc(peaks(250), [-6 0])
colormap(bluewhitered), colorbar

figure
surf(peaks)
colormap(bluewhitered)
axis tight

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
23 Dec 2003 Yannis Cuypers

Usefull, such a colormapwas actually missing in Matlab

29 Apr 2004 Johnny Cash

useful

31 Jul 2007 cynthia solly  
29 Nov 2007 John Doe

cool! good work!

04 May 2009 Kazem Edmond

EXACTLY what I needed. Thanks so much.

03 Mar 2011 Kim Bostroem

Absolutely useful. Incredible that it's not included in MATLAB already!!!

02 Feb 2012 Sandra  
27 Feb 2012 Ste

It's a great function! the only problem I encounter is when I try to fix the colorbar (with caxis). The zero does not stay in the same place (at the white)but moves to red or blue.. Anyone an idea how to solve that?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
annotation Nathan Childress 22 Oct 2008 07:08:41
customization Nathan Childress 22 Oct 2008 07:08:41
colormap Nathan Childress 22 Oct 2008 07:08:41
graphics Nathan Childress 22 Oct 2008 07:08:41
white Nathan Childress 22 Oct 2008 07:08:41
matrix Nathan Childress 22 Oct 2008 07:08:41
blue Nathan Childress 22 Oct 2008 07:08:41
plot Nathan Childress 22 Oct 2008 07:08:41
red Kazem Edmond 05 May 2009 12:06:42

Contact us at files@mathworks.com