8282 plt.plot([1, 2, 3], marker=11)
8383 plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE)
8484
85- Markers join and cap styles can be customized by creating a new instance of MarkerStyle.
86- A MarkerStyle can also have a custom
87- `~matplotlib.transforms.Transform` allowing it to be arbitrarily rotated or offset.
85+ Markers join and cap styles can be customized by creating a new instance of
86+ MarkerStyle.
87+ A MarkerStyle can also have a custom `~matplotlib.transforms.Transform`
88+ allowing it to be arbitrarily rotated or offset.
89+
8890Examples showing the use of markers:
8991
9092* :doc:`/gallery/lines_bars_and_markers/marker_reference`
150152_empty_path = Path (np .empty ((0 , 2 )))
151153
152154
153- def _fast_transform_combine (t1 , t2 ):
154- """Combine two transformations where the second one can be None."""
155- if t2 is None :
156- return t1 .frozen ()
157- else :
158- return (t1 + t2 ).frozen ()
159-
160-
161155class MarkerStyle :
162156 """
163157 A class representing marker types.
@@ -248,8 +242,9 @@ def __init__(self, marker=_unset, fillstyle=None,
248242 fillstyle : str, default: :rc:`markers.fillstyle`
249243 One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
250244
251- transform : Affine2D, default: None
252- Transform that will be combined with the native transform of the marker.
245+ transform : transforms.Transform, default: None
246+ Transform that will be combined with the native transform of the
247+ marker.
253248
254249 capstyle : CapStyle, default: None
255250 Cap style that will override the default cap style of the marker.
@@ -395,7 +390,10 @@ def get_transform(self):
395390 Return the transform to be applied to the `.Path` from
396391 `MarkerStyle.get_path()`.
397392 """
398- return _fast_transform_combine (self ._transform , self ._user_transform )
393+ if self ._user_transform is None :
394+ return self ._transform .frozen ()
395+ else :
396+ return (self ._transform + self ._user_transform ).frozen ()
399397
400398 def get_alt_path (self ):
401399 """
@@ -411,8 +409,10 @@ def get_alt_transform(self):
411409 Return the transform to be applied to the `.Path` from
412410 `MarkerStyle.get_alt_path()`.
413411 """
414- return _fast_transform_combine (self ._alt_transform ,
415- self ._user_transform )
412+ if self ._user_transform is None :
413+ return self ._alt_transform .frozen ()
414+ else :
415+ return (self ._alt_transform + self ._user_transform ).frozen ()
416416
417417 def get_snap_threshold (self ):
418418 return self ._snap_threshold
@@ -424,7 +424,7 @@ def get_user_transform(self):
424424
425425 def transformed (self , transform : Affine2D ):
426426 """
427- Return a new version of this marker with the transform applied.
427+ Return a new version of this marker with the transform applied.
428428
429429 Parameters
430430 ----------
0 commit comments