Skip to content

[Bug]: Path.cleaned() always returns a closed path #28176

Open
@mfreeborn

Description

@mfreeborn

Bug summary

I have a path - a simple line - which is created from a large number of points. I call the cleaned(simplify=True) method on it and it returns a closed path

Code for reproduction

path = Path([(0, 0.5), (1, 0.5), (2, 0.5), (3, 0.5), (4, 0.5)])
cleaned_path = path.cleaned(simplify=True)
# cleaned path coords now [(0, 0.5), (4, 0.5), (4, 0.5), (0, 0.5)]
# expected [(0, 0.5), (4, 0.5)]

Actual outcome

The path is simplified as I hoped, but it is now closed.

Expected outcome

For the path not to be closed.

Additional information

No response

Operating system

Ubuntu

Matplotlib Version

3.8.4

Matplotlib Backend

No response

Python version

3.12

Jupyter version

No response

Installation

pip

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