how to change the font size in a plot (only for the axes numbers) for double axis figure
31 ビュー (過去 30 日間)
古いコメントを表示
I have a problem changing axis font size of a double axis figure (i.e., plotyy). the font size is only changed for one of the axis
it is possible to change the font size of a single axis figure using the command "set(gca,'fontsize',number), what about the double axis.
0 件のコメント
回答 (2 件)
Voss
2023 年 8 月 4 日
Rather than relying on gca(), you can use the two axes handles returned by plotyy, as in:
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
figure % new figure
ax = plotyy(x,y1,x,y2);
set(ax(1),'FontSize',6)
set(ax(2),'FontSize',16)
Daniel Bengtson
2023 年 8 月 4 日
Save the axes handle when you create the plot rather than using gca.
[AX,h1,h2] = plotyy(1:10,rand(10,1),1:10,rand(10,1));
set(AX,'fontsize',20)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Two y-axis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!