Skip to content

Commit 89846f1

Browse files
committed
Don't mark a patch transform as set if the parent transform is not set.
When updating a patch from another artist, if the other artist's transform is marked as "uninitialized" (`_transformSet == False`), then don't mark the updatee's transform as set either. Typically, this occurs if the updator has not been added to an Axes yet; its transform will be set when that adding occurs. In that case, the updatee's transform also needs to be set when actually being added to an Axes.
1 parent 3a5d8c2 commit 89846f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/patches.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ def update_from(self, other):
175175
self._us_dashes = other._us_dashes
176176
self.set_linewidth(other._linewidth) # also sets dash properties
177177
self.set_transform(other.get_data_transform())
178+
# If the transform of other needs further initialization, then it will
179+
# be the case for this artist too.
180+
self._transformSet = other.is_transform_set()
178181

179182
def get_extents(self):
180183
"""

0 commit comments

Comments
 (0)