Skip to content

[Bug]: Update of markers' fillstyle removes rotation transform #31257

@williamlus

Description

@williamlus

Bug summary

This bug occurs when I plot markers with rotation transforms, store them in markers, and update the fillstyle of markers, which accidentally resets the rotation transforms.

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib.transforms import Affine2D
from matplotlib.markers import MarkerStyle

angles = [-20, 0, 20]

fig, ax = plt.subplots()
markers = []
for x, theta in enumerate(angles):
    lst = ax.plot(x, 0, marker=MarkerStyle('*', transform=Affine2D().rotate_deg(theta)), markersize=100)
    markers.extend(lst)
for marker in markers:
    marker.set_fillstyle('left')
plt.show()

Actual outcome

Image

Expected outcome

Image

Additional information

No response

Operating system

No response

Matplotlib Version

3.10.8

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions