dropshadow - Drop Shadow class for plot objects
Version 1.1.0.0 (4,65 KB) von
Maarten van der Seijs
Adds a dropshadow to plot objects.
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!
Zitieren als
Maarten van der Seijs (2024). dropshadow - Drop Shadow class for plot objects (https://www.mathworks.com/matlabcentral/fileexchange/39024-dropshadow-drop-shadow-class-for-plot-objects), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2012a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- MATLAB > Graphics > Formatting and Annotation > Labels and Annotations > Annotations >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > Image Arithmetic >
- MATLAB > Graphics > Graphics Objects > Graphics Object Properties >
- MATLAB > Graphics > Graphics Objects > Graphics Object Programming >
Mehr zu Annotations finden Sie in Help Center und MATLAB Answers
Tags
Quellenangaben
Inspiriert von: getscreen
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.1.0.0 | Updates as suggested by Paul Ackerman |
||
1.0.0.0 |