python - Matplotlib:如何在缩放时缩放颤动图?

标签 python matplotlib plot zooming arrows

我需要 matplotlib.quiver 方面的帮助.

我正在创建一些数据,这些数据给了我一个很好的颤动图:

Full Quiver Plot

箭头的尺寸很小,使绘图易于阅读。 但现在我想缩放(通过使用底部的放大镜符号)到左上角以查看红点周围的更多细节。我得到这张照片:

Zoomed Quiver Plot

这仍然是正确的,但现在可读性很差。箭头太短,看不清那里发生了什么。

所以我的问题是:我需要如何调用ax.quiver(*meshgrid, *data)缩放箭头长度,使其在放大时变得更大?

谢谢! :)

最佳答案

来自quiver documentation :

units : [ 'width' | 'height' | 'dots' | 'inches' | 'x' | 'y' | 'xy' ] The arrow dimensions (except for length) are measured in multiples of this unit.

'width' or 'height': the width or height of the axis

'dots' or 'inches': pixels or inches, based on the figure dpi

'x', 'y', or 'xy': respectively X, Y, or sqrt(X2+Y2) in data units

The arrows scale differently depending on the units. For 'x' or 'y', the arrows get larger as one zooms in; for other units, the arrow size is independent of the zoom state. For 'width or 'height', the arrow size increases with the width and height of the axes, respectively, when the window is resized; for 'dots' or 'inches', resizing does not change the arrows.

(强调我的)

关于python - Matplotlib:如何在缩放时缩放颤动图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54537677/

相关文章:

删除条形图中每个面板未使用的因素

python - 定义引发异常的 lambda 表达式

daemontools下的Python脚本没有收到信号15

导入 matplotlib.pyplot 时 Python 崩溃

python - Seaborn Plot 不显示

r - 翻转水平 barplot() 中条形的顺序(y 轴)(基础 R)

python - 使用 SQLAlchemy 在 POSTGRES 中计算 DATEDIFF

python - 根据文件名中的特定模式 move 文件,同时保留文件夹结构

python - 绘制排除 pandas 或 matplotlib 中缺失值的图表

r - 一张图中的多个部分依赖图