Sizing legend in a png file
5 views (last 30 days)
Show older comments
I am trying to resize the legend to cover only the bottom right corner of my figure. It looks good when I am running the code but it appears too large in the png file. What do you guys suggest in this situation? many thanks for your help.
4 Comments
Walter Roberson
on 31 Mar 2019
Your legend is being generated with a fixed font size and line width. Those do not refer to sizes relative to resolution: those refer to fixed sizes. Fontsize 11 is 11 points is 11/72 of an inch.
You are rendering the legend into an image with a somewhat small physical area. The legend has been defined to take up a large size relative to that small area.
With you using -r300 chances are good that you could have generated a perfectly readable legend with a smaller font size. Your current fontsize of 11 is 11/72*300 ~= 45 pixels, and your current linewidth of 1.5 is 1.5/72*300 ~= 6 pixels.
Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!