简体   繁体   中英

Matplotlib: How do I scale a quiver plot while zooming?

I need some help with matplotlib.quiver .

I was creating some data that give me a nice quiver plot:

完整的箭袋图

The arrows have a good small size to make the plot readable. But now I want to zoom (by using the magnifier symbol on the bottom) to the top left corner to see more details around the red dot. And I get this picture:

放大箭袋图

This is still right, but now it is bad readable. The arrows are too short to see what's going on there.

So my question is: How do I need to call ax.quiver(*meshgrid, *data) to scale the arrow lengths such that they will become larger when zooming into?

Thank you! :)

From the 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.

(emphasis mine)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM