当图形尺寸较大时,Matplotlib中的圆弧切断不起作用

2024-10-03 15:32:23 发布

您现在位置:Python中文网/ 问答频道 /正文

在plotm中,用其他的函数,得到一个切弧。在

让我在这里插入一段代码,它代表我要做的事情:

import matplotlib.pyplot as plt
from matplotlib.patches import Arc

plt.figure(figsize=(16, 16))

ax = plt.gca()

arc_element = Arc((0, 0), 475, 475, theta1=22, theta2=158, linewidth=2, zorder=0,
                color="k")

# Add the court elements onto the axes
ax.add_patch(arc_element)

plt.xlim(-252, 252)
plt.ylim(-65, 423)
plt.show()

此代码生成以下图像: Image with full circle

但当图形大小更改为:

^{pr2}$

我得到了想要的结果,在这里可以看到:

Image with arc only, correct result

作为参考,我使用的是python3.6.3和Matplotlib版本2.1.0。在


Tags: the函数代码importmatplotlibplt代表element