Edit linestyles of plot legends
by Johan Carlson
15 Nov 2008
(Updated 12 May 2009)
Simple fix for adding markers to plot legend lines.
|
Watch this File
|
| File Information |
| Description |
If a plot is sampled very densely, and one wants to add markers to the plot, this can be done by plotting two lines on top of each other. One being the smooth line, the other being a down-sampled version with the markers only (e.g. diamonds, squares)
Now, the above is fine as long as we don't need a plot legend, since the legend function will scan for all lines, and what we have is a combination.
This simple script is a work-around to the problem. There is also an example file included showing how to use the function. |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 12 May 2009 |
The function has been updated to also permit changing the color of lines and markers in the legend. The function is still backwards-compatible (so code using version 0.5 should still work) |
|
Contact us at files@mathworks.com