Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b9f61d

Browse files
authored
Merge pull request #17545 from timhoffm/doc-markerstyle
Improve docs of markers
2 parents c404d1f + efb292b commit 8b9f61d

File tree

1 file changed

+48
-12
lines changed

1 file changed

+48
-12
lines changed

lib/matplotlib/markers.py

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@
143143

144144

145145
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+
"""
146158

147159
markers = {
148160
'.': 'point',
@@ -202,18 +214,11 @@ class MarkerStyle:
202214

203215
def __init__(self, marker=None, fillstyle=None):
204216
"""
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-
213217
Parameters
214218
----------
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`.
217222
218223
fillstyle : str, default: 'full'
219224
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
@@ -249,11 +254,13 @@ def get_fillstyle(self):
249254

250255
def set_fillstyle(self, fillstyle):
251256
"""
252-
Sets fillstyle
257+
Set the fillstyle.
253258
254259
Parameters
255260
----------
256-
fillstyle : string amongst known fillstyles
261+
fillstyle : {'full', 'left', 'right', 'bottom', 'top', 'none'}
262+
The part of the marker surface that is colored with
263+
markerfacecolor.
257264
"""
258265
if fillstyle is None:
259266
fillstyle = rcParams['markers.fillstyle']
@@ -271,6 +278,15 @@ def get_marker(self):
271278
return self._marker
272279

273280
def set_marker(self, marker):
281+
"""
282+
Set the marker.
283+
284+
Parameters
285+
----------
286+
marker : str or array-like or None, default: None
287+
*None* means no marker. For other possible marker values see the
288+
module docstring `matplotlib.markers`.
289+
"""
274290
if (isinstance(marker, np.ndarray) and marker.ndim == 2 and
275291
marker.shape[1] == 2):
276292
self._marker_function = self._set_vertices
@@ -300,15 +316,35 @@ def set_marker(self, marker):
300316
self._recache()
301317

302318
def get_path(self):
319+
"""
320+
Return a `.Path` for the primary part of the marker.
321+
322+
For unfilled markers this is the whole marker, for filled markers,
323+
this is the area to be drawn with *markerfacecolor*.
324+
"""
303325
return self._path
304326

305327
def get_transform(self):
328+
"""
329+
Return the transform to be applied to the `.Path` from
330+
`MarkerStyle.get_path()`.
331+
"""
306332
return self._transform.frozen()
307333

308334
def get_alt_path(self):
335+
"""
336+
Return a `.Path` for the alternate part of the marker.
337+
338+
For unfilled markers, this is *None*; for filled markers, this is the
339+
area to be drawn with *markerfacecoloralt*.
340+
"""
309341
return self._alt_path
310342

311343
def get_alt_transform(self):
344+
"""
345+
Return the transform to be applied to the `.Path` from
346+
`MarkerStyle.get_alt_path()`.
347+
"""
312348
return self._alt_transform.frozen()
313349

314350
def get_snap_threshold(self):

0 commit comments

Comments
 (0)