View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Shaded pseudo color

5.0 | 1 rating Rate this file 5 Downloads (last 30 days) File Size: 772 KB File ID: #14157 Version: 1.0
image thumbnail

Shaded pseudo color


Jody Klymak (view profile)


04 Mar 2007 (Updated )

Use shading to represent secondary information of an image

| Watch this File

File Information

shadedpcolor displays one dataset in color, and a second by varying the intensity of the pixels in the image. We use this for displaying the vertical gradients in a field on top of the field itself. It really makes the field more three-d. A similar effect can be achieved by using lighting, but this is much more deterministic.

For the above picture I ran:

shadedpcolor(x,z,U,(dU),[-1 1]/4,[-1 1]/300,0.7,cmp,0);
axis ij;
shadedcolorbar('v',[-1 1]/4,0.7,cmp);


Freeze Colors / Unfreeze Colors inspired this file.

This file inspired Dcolor and Perceptually Improved Colormaps.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
09 Feb 2012 Matteo Niccoli

Hi Jody

Could you help me figure out how to get a handle for the figure.

If I run the code like this:
h=shadedpcolor(x,y,data,(data_slope)),[-3 3],[0 1],0.55,mycmap,0);

this is what happens
hp =


??? Output argument "h" (and maybe others) not assigned during call to "G:\For blog\Campi slope\shadedpcolor.m (shadedpcolor)".

Error in ==> shadedpcolor at 31
if nargin==0

But hp is not stored in a variable that I can use.

If I simply run the code without output arguments, like this:
shadedpcolor(x,y,data,(data_slope)),[-3 3],[0 1],0.55,mycmap,0);

I get
hp =


no error messages, but still cannot get a handle.


Comment only
22 Oct 2010 Matteo Niccoli

The figures resulting from the code snippet above are in the submission Perceptually improved colormaps (example2). Thank you

Comment only
22 Oct 2010 Matteo Niccoli

This is a great way to add shading to your data. I used it with very nice results with gravity anomalies with this code:

% slp=1-normalized_slope;
% shadedpcolor(x,y,residual,slp,[clim residual],[clim slp],0.55,jet(256),0);
% axis equal; axis off; axis tight;
% shadedcolorbar([clim residual],0.55,jet(256));

Contact us