MATLAB Answers

Set legends linewidth for all open figures/plots at once

16 ビュー (過去 30 日間)
ML
ML 2017 年 10 月 6 日
編集済み: David J. Mack 2017 年 10 月 6 日
Hi!
Since I a bit colourblind and using a 4k screen, so I need to set bigger fonts and linewidth so I see the text and colours properly.
So far, I've been able to add a function to my matlab path which I run every time I want to change the plot/figure to my liking. However, I am missing how I can edit the legend textwidth and font size. Is there a way to set a default value or for current session without having to sending the legend to a function, or to find it using:
get(findall(gca, 'type', ""LEGEND""))
This is the code I have so far:
This is the code so far:
function f = sfd() % set figure defaults
set(groot,'defaultLegendLineWidth',3)
set(groot,'defaultAxesLineWidth',1)
set(groot,'defaultGraphplotLineWidth',1)
set(groot, 'DefaultAxesTitleFontSizeMultiplier', 1.5) ;
set(groot,'defaultLineLineWidth',1)
set(findall(gcf,'type','line'),'linewidth',4);
set(findall(gca,'type','line'),'linewidth',4);
end
  1 件のコメント
David J. Mack
David J. Mack 2017 年 10 月 6 日
Hey Martin, does not seem to be that easy. You have to set the LegendFontSize and the LegendFontSizeMode to achieve an actual effect. Have a look here for a similar problem: Default Text Size in Legends

サインインしてコメントする。

回答 (0 件)

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by