8000 Improve docs of markers · matplotlib/matplotlib@bb0224a · GitHub
[go: up one dir, main page]

Skip to content

Commit bb0224a

Browse files
committed
Improve docs of markers
1 parent 4356b67 commit bb0224a

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

lib/matplotlib/markers.py

Lines changed: 46 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'.
@@ -246,11 +251,13 @@ def get_fillstyle(self):
246251

247252
def set_fillstyle(self, fillstyle):
248253
"""
249-
Sets fillstyle
254+
Set the fillstyle.
250255
251256
Parameters
252257
----------
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.
254261
"""
255262
if fillstyle is None:
256263
fillstyle = rcParams['markers.fillstyle']
@@ -268,6 +275,15 @@ def get_marker(self):
268275
return self._marker
269276

270277
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+
"""
271287
if (isinstance(marker, np.ndarray) and marker.ndim == 2 and
272288
marker.shape[1] == 2):
273289
self._marker_function = self._set_vertices
@@ -297,15 +313,33 @@ def set_marker(self, marker):
297313
self._recache()
298314

299315
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+
"""
300322
return self._path
301323

302324
def get_transform(self):
325+
"""
326+
Return the transform to be applied to the `.Path` from
327+
`MarkerStyle.get_path()`.
328+
"""
303329
return self._transform.frozen()
304330

305331
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+
"""
306336
return self._alt_path
307337

308338
def get_alt_transform(self):
339+
"""
340+
Return the transform to be applied to the `.Path` from
341+
`MarkerStyle.get_alt_path()`.
342+
"""
309343
return self._alt_transform.frozen()
310344

311345
def get_snap_threshold(self):

0 commit comments

Comments
 (0)
0