作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个问题,这可能是一个简单的解决方案。我使用 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)。我可能想多了,发布后我会觉得自己很愚蠢。
最佳答案
Circle()
takes a boolean fill
argument
做
circle2 = plt.Circle((0, 0), 3, color='k', fill=False)
ax.add_artist(circle2)
你得到
关于python - 如何在matplotlib中画一个没有填充的圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64364398/
我是一名优秀的程序员,十分优秀!