Edit linestyles of plot legends
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.
Cita come
Johan Carlson (2025). Edit linestyles of plot legends (https://it.mathworks.com/matlabcentral/fileexchange/22116-edit-linestyles-of-plot-legends), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- MATLAB > Graphics > Labels and Styling > Labels and Annotations > Annotations >
- MATLAB > Graphics > 2-D and 3-D Plots > Line Plots > Change Markers >
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
