|
|
| File Information |
| Description |
AddReorderButtons adds two buttons to the top toolbar of a specified figure. When clicked while a plot object is selected, they will move that object "forward" or "backward" in the rendering list. This is most practically useful for multiple 2D plots in the same axes, in which one plot may partially or completely obscure another; this is a simple way of moving the obscured plot forward without having to change the code that generated the figure.
I personally find this function most useful as part of my DefaultFigureCreateFcn callback, so that all new figures include the buttons. An example of how to do this is included in the download.
Written in R2007b, but should work for the most recent versions of MATLAB.
Example usage:
Enter the following commands at the MATLAB prompt:
>> figure
>> fv.vertices = [-1 0; 0 1; 1 0; 0 -1];
>> fv.faces = [1 2 3 4];
>> fv.facevertexcdata = [0 1 0];
>> patch(fv,'FaceColor','flat')
>> fv.vertices = [-1 -1;-1 1;1 1;1 -1]./sqrt(2);
>> fv.facevertexcdata = [1 0 0];
>> AddReorderButtons
You should have a plot with two overlapping squares, one red and one green. Select the "Edit Plot" tool, and click on the square on top. Press the "Move Current Plot Object Backward" tool to see the reorder buttons in action. |
| MATLAB release |
MATLAB 7.4 (R2007a)
|
| Zip File Content |
|
| Other Files |
setup_figure.m, AddReorderButtons.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (9) |
| 28 Dec 2007 |
M.Tauha Ali
|
|
|
| 30 Dec 2007 |
V P
|
|
|
| 31 Dec 2007 |
Geoffrey Adams
|
|
|
| 31 Dec 2007 |
V P
|
|
|
| 01 Jan 2008 |
V P
|
|
|
| 02 Jan 2008 |
Geoffrey Adams
|
|
|
| 06 Jan 2008 |
V P
|
|
|
| 07 Jan 2008 |
V P
|
|
|
| 21 Jan 2008 |
zhang hongx
|
|
|
| Updates |
| 24 Jan 2008 |
Added example usage to description. |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com