使用投影时出现问题“类型错误:不支持更改地理投影的轴限制。”
我正在尝试使用投影 aitoff 绘制两个带有坐标的数组(大约 480 万个元素),例如:
fig = plt.figure(figsize=(12,10))
ax = fig.add_subplot(111, projection="aitoff")
ax.grid(alpha=0.3)
ax.hist2d(ra, dec, bins = 100)
但出现以下错误:
TypeError: Changing axes limits of a geographic projection is not supported. Please consider using Cartopy.
坐标(ra
和 dec
) 已经是弧度了。 我还尝试了以下 hexbin:
ax.hexbin(ra, dec, bins = 100)
,效果很好。你能帮忙吗?
I am trying to plot two arrays with coordinates (around 4.8 millions elements) using the projection aitoff
like:
fig = plt.figure(figsize=(12,10))
ax = fig.add_subplot(111, projection="aitoff")
ax.grid(alpha=0.3)
ax.hist2d(ra, dec, bins = 100)
But I get the following error:
TypeError: Changing axes limits of a geographic projection is not supported. Please consider using Cartopy.
The coordinates (ra
and dec
) are already in radians.
I also tried with the following hexbin:
ax.hexbin(ra, dec, bins = 100)
and that works. Can you please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案。这是一个使用度数而不是弧度手动投影所有点的函数:
然后
I found an answer. Here is a function to manually project all the points using degrees instead of radians:
And then