143
143
144
144
145
145
class MarkerStyle :
146
+ """
147
+ A class representing marker types.
148
+
149
+ Attributes
150
+ ----------
151
+ markers : list
152
+ All known markers.
153
+ filled_markers : list
154
+ All known filled markers. This is a subset of *markers*.
155
+ fillstyles : list
156
+ The supported fillstyles.
157
+ """
146
158
147
159
markers = {
148
160
'.' : 'point' ,
@@ -202,18 +214,11 @@ class MarkerStyle:
202
214
203
215
def __init__ (self , marker = None , fillstyle = None ):
204
216
"""
205
- Attributes
206
- ----------
207
- markers : list of known marks
208
-
209
- fillstyles : list of known fillstyles
210
-
211
- filled_markers : list of known filled markers.
212
-
213
217
Parameters
214
218
----------
215
- marker : str or array-like, default: None
216
- See the descriptions of possible markers in the module docstring.
219
+ marker : str or array-like or None, default: None
220
+ *None* means no marker. For other possible marker values see the
221
+ module docstring `matplotlib.markers`.
217
222
218
223
fillstyle : str, default: 'full'
219
224
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
@@ -246,11 +251,13 @@ def get_fillstyle(self):
246
251
247
252
def set_fillstyle (self , fillstyle ):
248
253
"""
249
- Sets fillstyle
254
+ Set the fillstyle.
250
255
251
256
Parameters
252
257
----------
253
- fillstyle : string amongst known fillstyles
258
+ fillstyle : {'full', 'left', 'right', 'bottom', 'top', 'none'}
259
+ The part of the marker surface that is colored with
260
+ markerfacecolor.
254
261
"""
255
262
if fillstyle is None :
256
263
fillstyle = rcParams ['markers.fillstyle' ]
@@ -268,6 +275,15 @@ def get_marker(self):
268
275
return self ._marker
269
276
270
277
def set_marker (self , marker ):
278
+ """
279
+ Set the marker.
280
+
281
+ Parameters
282
+ ----------
283
+ marker : str or array-like or None, default: None
284
+ *None* means no marker. For other possible marker values see the
285
+ module docstring `matplotlib.markers`.
286
+ """
271
287
if (isinstance (marker , np .ndarray ) and marker .ndim == 2 and
272
288
marker .shape [1 ] == 2 ):
273
289
self ._marker_function = self ._set_vertices
@@ -297,15 +313,33 @@ def set_marker(self, marker):
297
313
self ._recache ()
298
314
299
315
def get_path (self ):
316
+ """
317
+ Return a `.Path` for the primary part of the marker.
318
+
319
+ For unfilled markers this is the whole marker, for filled markers,
320
+ this is the area to be drawn with *markerfacecolor*.
321
+ """
300
322
return self ._path
301
323
302
324
def get_transform (self ):
325
+ """
326
+ Return the transform to be applied to the `.Path` from
327
+ `MarkerStyle.get_path()`.
328
+ """
303
329
return self ._transform .frozen ()
304
330
305
331
def get_alt_path (self ):
332
+ """
333
+ Return a `.Path` for the area to be drawn with *markerfacecoloralt*,
334
+ or *None* for unfilled markers.
335
+ """
306
336
return self ._alt_path
307
337
308
338
def get_alt_transform (self ):
339
+ """
340
+ Return the transform to be applied to the `.Path` from
341
+ `MarkerStyle.get_alt_path()`.
342
+ """
309
343
return self ._alt_transform .frozen ()
310
344
311
345
def get_snap_threshold (self ):
0 commit comments