我有一个问题,这可能是一个简单的解决方案。我放下python几个月了,现在我试图创建一些视觉效果,但是我介意如何做到这一点。
import matplotlib.pyplot as plt
circle1 = plt.Circle((0, 0), .5, color='r')
fig, ax = plt.subplots()
plt.xlim(-5,5)
plt.xlabel('AU')
plt.ylim(-5,5)
plt.ylabel('AU')
plt.grid(linestyle='-')
ax.set_aspect(1)
ax.add_artist(circle1)
plt.title('Habitable Zone Around the Sun ', fontsize=8)
plt.show()
此代码为我提供了一个固定的“太阳”,我正在尝试在1AU处创建“地球轨道”,并为内半径和外半径创建一个适合居住区域的径向壳(例如.8 AU和1.2 AU)。我可能对此考虑过头了,在发布此内容后会感到愚蠢。
答案 0 :(得分:3)
Circle()
takes a boolean fill
argument
做
circle2 = plt.Circle((0, 0), 3, color='k', fill=False)
ax.add_artist(circle2)
你会得到