Skip to content

RegularPolygon does not close path if fill=False #5119

@maxnoe

Description

@maxnoe

The edge path of the RegularPolygon does not get closed properly if fill=False:

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

fig, ax = plt.subplots()
ax.set_aspect('equal')

poly = RegularPolygon(
    xy=(0, 0),
    radius=10,
    numVertices=6,
    fill=False,
    linewidth=5,
)

ax.add_artist(poly)
ax.set_xlim(-11, 11)
ax.set_ylim(-11, 11)
fig.savefig('test_poly.pdf')

results in:
test_poly

While the edgepath with fill=True is properly closed:
test_poly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions