在子图中对齐ylabel [英] Align the ylabel in subplots

查看:231
本文介绍了在子图中对齐ylabel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个子图(一个在另一个图下),每个子图的y轴用不同的值表示(例如,第一个是1:5,第二个是10:1000,依此类推)

I have several subplots (one beneath the other), and the y-axis of each subplots ticks with different values (say the first is 1:5 and the second is 10:1000 etc.)

因此,结果是每个ylabel将具有不同的对齐方式. 有没有办法来解决这个问题?例如-将所有ylabel对齐到左侧?还是有其他解决方案?

So the result is that each ylabel will have different alignment. Is there a way to fix this? For example - to align all the ylabels to the left? Or is there another solution?

推荐答案

尝试一下:

xpos = -18 % (find this out from get(yl,'pos') on the desired label x-location)
yl=ylabel('Label Here')
pos=get(yl,'Pos')
set(yl,'Pos',[xpos pos(2) pos(3)])

类似地,对每个子图执行此操作.您会发现x位置始终保留着,其他位置是默认位置.

similarly, do this for each subplot. You will find the x-location is retained throughout, and the other positions are default.

这篇关于在子图中对齐ylabel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆