我试图隐藏或删除超出“outer_arc_left”和“outer_arc_right”的“outer_rect”部分,以重新创建溜冰场。
谢谢你。
from matplotlib.patches import Rectangle, Arc
def draw_rink(ax=None, color='black', lw=2, outer_lines=False):
if ax is None:
ax = plt.gca()
outer_rect = Rectangle((-1500, 3000), 3000, 3000, linewidth=lw, color=color, fill=False)
outer_arc_left = Arc((-700, 5200), 1600, 1600, theta1=90, theta2=180, linewidth=lw, color=color)
outer_arc_right = Arc((700, 5200), 1600, 1600, theta1=0, theta2=90, linewidth=lw, color=color)
rink_elements = [outer_rect, outer_arc_left, outer_arc_right]
for element in rink_elements:
ax.add_patch(element)
return ax
三国纷争
相关分类