How to set a default marker size in the legend?
Show older comments
Hello,
Every time I open a saved figure, it appears not as I had saved it, but with the default configurations of MatLab. To get around this, I use the command
set(0,'defaultAxesFontSize',25, ...
'defaultAxesTitleFontSizeMultiplier', 24/25)
This command makes de default axes font size to be 25 and the title font, to be 24. Nevertheless, I could not use the same command for the marker size in the legend. In other words, I couldn't find a command of the type
set(0,'defaultMarkerSize',10)
Is there a command that does this? (Another welcome solution would be a way to open the saved figures with the original configurations I choosed to them.)
As an example, I've made the following simple program:
x = randn(1,1000);
y = randn(1,1000);
figure, plot(x,y, '.')
legend('randn')
[h,icons] = legend('randn');
icons(3).MarkerSize = 15; % This line makes the marker size of the legend bigger
The result is as follows from the figure (a). When I save and then reopen this figure, however, the marker size of the legend comes back to be the smaller size (equal to the size of the points in the graphic). Figure (b) shows this event. Is there a way to set a default marker size in the legend so this wouldn't happen?
Thanks
ps: I am using MatLab 2018a
,1 Comment
Martim Zurita
on 6 Jun 2019
Answers (1)
pankhuri kasliwal
on 7 Jun 2019
To change the marker size of the legend you can simply do
set(icons(3), 'Markersize', 12); %set marker size as desired
1 Comment
Martim Zurita
on 7 Jun 2019
Categories
Find more on Graphics Object Properties 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!