[英]How to plot matplotlib quiver arrows over x-axis and y-axis? - Python
Currently my plot made with matplotlib looks like figure 1, as you can see on the x-axis, the half of my arrow is being covered by the axis.目前我用 matplotlib 制成的 plot 看起来像图 1,正如您在 x 轴上看到的那样,我的箭头的一半被轴覆盖。
I would like it so the entire arrow is shown as in Figure 2.我想要它,所以整个箭头如图 2 所示。
Here is the relevant part of my code, X_fine and Y_fine have same range as X and Y but with more bins.这是我的代码的相关部分,X_fine 和 Y_fine 与 X 和 Y 具有相同的范围,但具有更多的 bin。
X, Y = np.meshgrid(arrow_csf_centre, arrow_precip_centre)
X_fine, Y_fine = np.meshgrid(arrow_csf_centre_fine, arrow_precip_centre_fine)
plt.contourf(X_fine, Y_fine, np.transpose(counts2_fine), 30)
plt.quiver(X,
Y,
np.transpose(arrow_dirs[:,:,0]),
np.transpose(arrow_dirs[:,:,1]),
angles='xy',
scale_units='xy',
scale=1,
pivot='mid')
Thanks for reading!谢谢阅读!
You can add: clip_on=False
in plt.quiver
您可以在
plt.quiver
中添加: clip_on=False
This should do it.这应该这样做。
Related: How do I let my matplotlib plot go beyond the axes?相关: 如何让我的 matplotlib plot go 超出轴?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.