gpt4 book ai didi

Matlab:将 y 轴标签定位到顶部

转载 作者:行者123 更新时间:2023-12-04 02:11:18 26 4
gpt4 key购买 nike

每次读者阅读图表时,他们都必须旋转头部以阅读 y 轴。看完documentation并在互联网上搜索,我仍然无法弄清楚。如何将 y 轴标签放置在 y 轴的顶部而不是 y 轴的左侧。

例如 enter image description here

enter image description here

最佳答案

您可以创建 ylabel 对象,然后手动调整其属性:'Position''Rotation':

plot(1:.1:10, (1:.1:10).^2); % example plot
t = title('Title');
y = ylabel('ylabel');
vf = 1.125; % vertical factor. Adjust manually
dy = .55; % horizontal offset. Adjust manually
tpos = get(t, 'Position');
theight = tpos(2);
ypos = get(y, 'Position');
set(y, 'Position', [ypos(1)+dy tpos(2)*1.02 ypos(3)], 'Rotation', 0)

这给出了下图:

enter image description here

关于Matlab:将 y 轴标签定位到顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38085628/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com