when using legend in a plot in live script, the font size becomes small.Why?
조회 수: 1 (최근 30일)
이전 댓글 표시
I use matlab R2019a.
When legend used, the result is like this:
![fdsfsda.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248953/fdsfsda.png)
when legend NOT used, the result is like this:
![saf.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248954/saf.png)
Why does this happen?
This didn't happen when I tried this with R2017b in my coworker's computer and with R2019b in my computer.
댓글 수: 0
답변 (1개)
Etsuo Maeda
2019년 11월 22일
This is a known issue in Live Editor from R2019a.
As a workaround, please avoid to use the graphics root object "groot" ( = 0) to set FontSize of your single figure. FontSize property in the axes object will help you to set your FontSize.
Also plese note that "groot" changes ROOT settings of the graphics object in MATLAB. I recommend you not to use "groot" casually.
h = plot(1:10);
ax = gca;
ax.FontSize = 20;
legend(ax, 'FontSize', 20)
HTH
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!