How to change the font size in all plots in the live editor (live scripts)?
조회 수: 5 (최근 30일)
이전 댓글 표시
In the live editor, I can get multiple plots together. For example:
x=1:100;
y1=x;
y2=x.^2;
y3=x.^3;
plot(x,y1)
plot(x,y2)
plot(x,y3)
Then I can get the following result:
Now, my question is "how can I change the all font size in the three plots?"
I can get the result I want by adding the codes as below:
x=1:100;
y1=x;
y2=x.^2;
y3=x.^3;
plot(x,y1)
set(gca,'FontSize',15)
plot(x,y2)
set(gca,'FontSize',15)
plot(x,y3)
set(gca,'FontSize',15)
but I don't want to write the code to change the font size many times.
I want a simpler way to change the font size, or the way to change the default font size in plots.
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 6월 26일
set(findobj(groot, 'type', 'axes'), 'FontSize', 15)
댓글 수: 2
Walter Roberson
2019년 6월 26일
Livescript creates a new axes for each plot, and it appears to hide some of them. You would need to change the findobj to findall
참고 항목
카테고리
Help Center 및 File Exchange에서 Visual Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!