import numpy as np
import matplotlib.pyplot as plt
data = plt.imread("yourimagehere.png")
fig = plt.figure()
#create axes in the background to show cartesian image
ax0 = fig.add_subplot(111)
ax0.imshow(data)
ax0.axis("off")
# create polar axes in the foreground and remove its background
# to see through
ax = fig.add_subplot(111, projection="mollweide", label="polar")
#you can change to other projections like "hammer"
ax.set_facecolor("None")
plt.show()
感谢用户ImportanceOfBeingErnest的评论,了解了它的工作原理。这是有效的代码:
相关问题 更多 >
编程相关推荐