I asked this question because, on the figures I'm currently working with, the default size of the markers in the legend is very small. An example is shown below.
How to set a default marker size in the legend?
79 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
,
Respuestas (1)
pankhuri kasliwal
el 7 de Jun. de 2019
To change the marker size of the legend you can simply do
set(icons(3), 'Markersize', 12); %set marker size as desired
1 comentario
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!