How to change the font size in all plots in the live editor (live scripts)?
2 次查看(过去 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:
![コメント 2019-06-26 130612.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226352/%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%202019-06-26%20130612.png)
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!