Can I define two default font sizes using set()

3 ビュー (過去 30 日間)
James Mulhern
James Mulhern 2022 年 3 月 9 日
回答済み: ag 2023 年 10 月 13 日
I use a startup script to set my default figure font size to 18 point using the following command.
set(groot,'DefaultAxesFontSize',18);
I default the figure style to 'docked' so this size works well for me. My issue is that this also changes the font size in live scripts.
When using live scripts with 18p figure font the axis area ends up quite small. I would perfer to use 10p font for live script figures. Setting the 'DefaultAxisFontSize' to 10 allows for small defualt font, however I would like to have two setting.
Is it posible to define two defaults, one for live scripts and one for other figures? Thanks

回答 (1 件)

ag
ag 2023 年 10 月 13 日
Hi James,
I understand that you need to set different font sizes for figure in live script window and for the same when opened separately in figure window.
Unfortunately, the graphics root is the same for figures live scripts and all the rest of MATLAB, so you cannot specify a graphics property specific to all live scripts but not to other figures. However, you can use the same syntax to specify default properties for a specific figure or axes.
Please refer to the following documentation for more details: https://www.mathworks.com/help/matlab/creating_plots/default-property-values.html
Hope this helps!
Best Regards,
Aryan Gupta

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by