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

Skip to content

Commit 4c9a407

Browse files
committed
Add docstrings
1 parent acbac82 commit 4c9a407

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

lib/matplotlib/path.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def _update_values(self):
156156

157157
@property
158158
def vertices(self):
159+
"""
160+
The list of vertices in the `Path` as an Nx2 numpy array.
161+
"""
159162
return self._vertices
160163

161164
@vertices.setter
@@ -167,6 +170,14 @@ def vertices(self, vertices):
167170

168171
@property
169172
def codes(self):
173+
"""
174+
The list of codes in the `Path` as a 1-D numpy array. Each
175+
code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4`
176+
or `CLOSEPOLY`. For codes that correspond to more than one
177+
vertex (`CURVE3` and `CURVE4`), that code will be repeated so
178+
that the length of `self.vertices` and `self.codes` is always
179+
the same.
180+
"""
170181
return self._codes
171182

172183
@codes.setter
@@ -178,27 +189,56 @@ def codes(self, codes):
178189

179190
@property
180191
def simplify_threshold(self):
192+
"""
193+
The fraction of a pixel difference below which vertices will
194+
be simplified out.
195+
"""
181196
return self._simplify_threshold
182197

198+
@simplify_threshold.setter
199+
def simplify_threshold(self, threshold):
200+
self._simplify_threshold = threshold
201+
183202
@property
184203
def has_nonfinite(self):
204+
"""
205+
`True` if the vertices array has nonfinite values.
206+
"""
185207
return self._has_nonfinite
186208

187209
@property
188210
def should_simplify(self):
211+
"""
212+
`True` if the vertices array should be simplified.
213+
"""
189214
return self._should_simplify
190215

216+
@should_simplify.setter
217+
def should_simplify(self, should_simplify):
218+
self._should_simplify = should_simplify
219+
191220
@property
192221
def readonly(self):
222+
"""
223+
`True` if the `Path` is read-only.
224+
"""
193225
return self._readonly
194226

195227
def __copy__(self):
228+
"""
229+
Returns a shallow copy of the `Path`, which will share the
230+
vertices and codes with the source `Path`.
231+
"""
196232
import copy
197233
return copy.copy(self)
198234

199235
copy = __copy__
200236

201237
def __deepcopy__(self):
238+
"""
239+
Returns a deepcopy of the `Path`. The `Path` will not be
240+
readonly, even if the source `Path` is.
241+
"""
202242
return self.__class__(
203243
self.vertices.copy(), self.codes.copy(),
204244
_interpolation_steps=self._interpolation_steps)

0 commit comments

Comments
 (0)