Set legends linewidth for all open figures/plots at once
조회 수: 7 (최근 30일)
이전 댓글 표시
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
2017년 10월 6일
편집: 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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!