how to manually add a legend?
Show older comments
I have generated a Matlab plot, but unfortunately I did not save it in Matlab. I saved only a screenshot from the figure. I need to add a legend.
How can I add it manually?
2 Comments
I see three obvious options:
- Recreate the plot from the data and incorporate a legend as needed.
- Create a dummy plot using the same linestyle and color; add a legend to the dummy plot and save as an image. Crop the legend from the dummy plot and paste it into the old image using any convenient image editing software.
- Create a dummy plot, display the image in the same axes, then call legend so that it's stacked on top of the image. Wrestle with position properties in order to make it not look ridiculous.
Hana Ahmed
on 24 Nov 2021
Accepted Answer
More Answers (0)
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

