필터 지우기
필터 지우기

How to set a default marker size in the legend?

조회 수: 65 (최근 30일)
Martim Zurita
Martim Zurita 2019년 6월 4일
댓글: Martim Zurita 2019년 6월 7일
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
Screen Shot 2019-06-04 at 18.07.19.png,
  댓글 수: 1
Martim Zurita
Martim Zurita 2019년 6월 6일
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.
ode113_phi2_2p2_I0_0p578e579_psi0_0_i_1e4_Tol_13_14_alfa_pi.png

댓글을 달려면 로그인하십시오.

답변 (1개)

pankhuri kasliwal
pankhuri kasliwal 2019년 6월 7일
To change the marker size of the legend you can simply do
set(icons(3), 'Markersize', 12); %set marker size as desired
  댓글 수: 1
Martim Zurita
Martim Zurita 2019년 6월 7일
Pankhuri,
Thanks for your answer. I know how to change the size of the marker in the legend. I did this in this line shown above:
icons(3).MarkerSize = 15;
The thing is that I want to change the default value of the legend marker size. Because everytime I open a saved figure, it appears with the MatLab default configurations, not the ones I've saved the figure with.
It is very annoying to change by hand the legend marker size every time I open a figure. This is why I want a default configuration of the legend marker size or a way to open the figure with the configurations I've saved to it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by