Matplotlib极坐标图的反向径向轴

Matplotlib极坐标图的反向径向轴,第1张

Matplotlib极坐标图的反向径向轴

这有点“ hacky”,但是如果您知道界限(看起来像是与磁偏角相对应的样子),则可以执行以下 *** 作:

import matplotlib.pyplot as pltimport numpy as npfig = plt.figure()ax = fig.add_axes([0.1,0.1,0.8,0.8], polar=True)# ax.invert_yaxis()ax.set_theta_zero_location('N')ax.set_rlim(90, -45, 1)# Note: you must set the end of arange to be slightly larger than 90 or it won't include 90ax.set_yticks(np.arange(-45, 91, 15))ax.set_yticklabels(ax.get_yticks()[::-1])ax.plot([0,10,20], 90-np.array([12,13,14]), linestyle='', marker='.')fig.show()


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5674449.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存