Code covered by the BSD License  

Highlights from
Shaded pseudo color

5.0

5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 771.58 KB File ID: #14157
image thumbnail

Shaded pseudo color

by Jody Klymak

 

04 Mar 2007 (Updated 06 Mar 2007)

Use shading to represent secondary information of an image

| Watch this File

File Information
Description

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);

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
freezeColors / unfreezeColors
This submission has inspired the following:
dcolor, Perceptually improved colormaps

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
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:

%figure;
% 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));

22 Oct 2010 Matteo Niccoli

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

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 =

  176.0052

??? 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 =

  164.0060

no error messages, but still cannot get a handle.

Thanks
Matteo

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Jody Klymak 22 Oct 2008 09:02:47
plotting Jody Klymak 22 Oct 2008 09:02:47
graphics Jody Klymak 22 Oct 2008 09:02:47
shaded Jody Klymak 22 Oct 2008 09:02:47
image Jody Klymak 22 Oct 2008 09:02:47
surface Jody Klymak 22 Oct 2008 09:02:47
pcolor Jody Klymak 22 Oct 2008 09:02:47
shading Gautam Vallabha 17 Jun 2009 11:13:22
specialized John Barber 14 Oct 2010 12:59:06

Contact us at files@mathworks.com