Controlling Y-Axis Label Properties on Multi-Axis Plots

2 次查看(过去 30 天)
Hi all,
I'm using plotyy to make a graph of my data, but I cannot figure out how to programmatically edit the y-axis labels. Specifically, I would like to change the font size. Because I'm using plotyy, ylabel is off the table. Using set(ax,'FontSize',value) only affects the axis tick labels, x label, and legend.
Thanks,
Clay

回答(1 个)

Luffy
Luffy 2012-7-10
For example:
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
[AX,H1,H2] = plotyy(x,y1,x,y2,'plot');
set(get(AX(1),'Ylabel'),'String','Slow Decay') ;
set(get(AX(2),'Ylabel'),'String','Fast Decay');
set(get(AX(2),'Ylabel'),'FontSize',30); % You can replace 30 with size you want.
% Similarly for other axis.

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by