Code covered by the BSD License  

Highlights from
dropshadow - Drop Shadow class for plot objects

5.0

5.0 | 1 rating Rate this file 22 Downloads (last 30 days) File Size: 4.6 KB File ID: #39024
image thumbnail

dropshadow - Drop Shadow class for plot objects

by

 

Adds a dropshadow to plot objects.

| Watch this File

File Information
Description

Every now and then your crude and harsh Matlab plots can benefit from some graphical enhancements. This class adds a fully customisable dropshadow to the plot objects in your axes. It takes a "snapshot" of the current axes and renders a dropshadow image using 2D convolution with a Gaussian kernel. Still, the figure can be exported to a vector graphics format, making it ideal for printed reports or PDFs.

Usage:
ShadowObj = dropshadow(hAxes) creates a dropshadow object for the plot objects in the specified axes. The shadow image is rendered using 2D convolution of a Gaussian kernel based on the properties Color, Angle, Distance, Spread and Size. The original plot objects are kept, such that the figure can still be exported to a vector graphics format such as EPS or PDF.
 
ShadowObj = dropshadow(hAxes,'Prop1',Value1,...) creates the dropshadow and sets the specified properties.
 
The dropshadow object is updated whenever a change is made to one of the properties. The object is deleted upon axes deletion.
 
Note that the shadow is always put as a 2D image in the background of the plot axes, regardless of 3D rotations.

Known issues:
The current implementation uses the java.awt.Robot to make a snapshot. This will not work with docked figures. A workaround is to use the built-in getframe function, which is activated by setting the hidden property ShadowObj.SnapMethod = 'getframe'. Suggestions for more robust implementations are welcome!

Acknowledgements

Getscreen inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
20 Nov 2013 Frank

Great effect! Just make sure the 'units' of root are pixels before getting the monitor size.

20 Nov 2013 Frank  

Contact us