Code covered by the BSD License  

Highlights from
SHADOWPLOT

4.33333

4.3 | 4 ratings Rate this file 35 Downloads (last 30 days) File Size: 3.96 KB File ID: #6400
image thumbnail

SHADOWPLOT

by Scott Hirsch

 

27 Nov 2004 (Updated 06 Jan 2010)

Add a shadow to an existing surface plot.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

SHADOWPLOT Add a shadow to an existing surface plot
 
For some surface plots, it can be helpful to visualize the shadow (2D projection) of the surface. This can give a quick perspective on the data's variance.
 
SHADOWPLOT PLANE Adds a shadow plot on the PLANE boundary

PLANE can be:
x, y, or z: Plots on back/top wall of x, y or z
1 .. 6 : Plots on Nth wall, numbered as in AXIS:
[xmin xmax ymin ymax zmin zmax]
 
SHADOWPLOT(HAX,PLANE) Adds a shadow plot on the Nth wall on axes HAX
HS = SHADOWPLOT(...) Returns a handle to the shadow (a patch)
 
Examples:
     figure
     surf(peaks)
     shading interp
     shadowplot x % Back X Wall
     shadowplot y % Back Y Wall

Acknowledgements

Octave inspired this file.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
3d(2), plotting, shadow(4), specialized, surface
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
30 Jan 2013 Usman Ali

hi, can we use shadow plot of plot3(), i am trying to do so but no successful. it only works with mesh/surf plots. help

28 Jan 2012 Pavel M.  
09 Mar 2010 Joseph Kirk

line 79: if length(axis==4)

I don't think this achieves the intended purpose. (axis==4) will evaluate to a logical array of either 4 or 6 elements. length(axis==4) will thus equal 4 or 6, so the if-statement will always execute.

It should be: if length(ax)==4
This will execute the if-statement if the axis view is 2D, but not if the view is already 3D.

23 Feb 2010 Clayton

Works well. Found a coding error: change line 120 to "surfdata{2} = repmat(surfdata{2}',1,Nx);"

30 Jan 2006 John D'Errico

Its former self is only a "shadow" of what it is now. Sorry. I had to say it. 8-)

16 Jan 2006 John D'Errico

I liked the idea until I tried it out. Shadowplot is of limited use in its current form. It works very nicely on the output of peaks, so then I tried it on one of my own 3d plots. It fails on more general patch objects, able to work on only objects of type 'surface'.

Updates
26 Jan 2006

Including nice enhancements from John D'Errico to include patches, too (it used to support just surfaces).

12 Sep 2007

Now includes limited support for data inside of HGTRANSFORMS. Thanks to Patrick Barney for this enhancement.

06 Jan 2010

Updated copyright.

Contact us