MATLAB-如何一起放大子图? [英] MATLAB - How to zoom subplots together?

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

问题描述

我在一个图中有多个子图.每个图的X轴是相同的变量(时间).每个图上的Y轴都不同(代表的是Y轴,数据的幅值是).

我想要一种同时放大所有绘图上的时间刻度的方法.理想情况下,通过在其中一个图上使用矩形缩放工具,并让其他图相应地更改其X极限.对于所有这些,Y限制应保持不变.可以自动拟合数据以在Y方向上填充图.

(此问题几乎与Stack Overflow问题一相同 Matplotlib /Pyplot:如何一起放大子图? ( MATLAB 除外) ))

解决方案

使用内置的 linkaxes 功能如下:

linkaxes([hAxes1,hAxes2,hAxes3], 'x');

要进行更高级的链接(不仅限于x或y轴),请使用内置的 linkprop 功能

I have multiple subplots in one figure. The X axis of each plot is the same variable (time). The Y axis on each plot is different (both in what it represents and the magnitude of the data).

I would like a way to zoom in on the time scale on all plots simultaneously. Ideally by using the rectangle zoom tool on one of the plots, and having the other plots change their X limits accordingly. The Y limits should remained unchanged for all of this. Auto fitting the data to fill the plot in the Y direction is acceptable.

(This question is almost identical to Stack Overflow question one Matplotlib/Pyplot: How to zoom subplots together? (except for MATLAB))

解决方案

Use the built-in linkaxes function as follows:

linkaxes([hAxes1,hAxes2,hAxes3], 'x');

For more advanced linking (not just the x or y axes), use the built-in linkprop function

这篇关于MATLAB-如何一起放大子图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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