MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _set_marker

Method _set_marker

lib/matplotlib/markers.py:298–333  ·  view source on GitHub ↗

Set the marker. Parameters ---------- marker : str, array-like, Path, MarkerStyle - Another instance of `MarkerStyle` copies the details of that *marker*. - For other possible marker values see the module docstring `matplotlib.m

(self, marker)

Source from the content-addressed store, hash-verified

296 return self._marker
297
298 def _set_marker(self, marker):
299 """
300 Set the marker.
301
302 Parameters
303 ----------
304 marker : str, array-like, Path, MarkerStyle
305 - Another instance of `MarkerStyle` copies the details of that *marker*.
306 - For other possible marker values see the module docstring
307 `matplotlib.markers`.
308 """
309 if isinstance(marker, str) and cbook.is_math_text(marker):
310 self._marker_function = self._set_mathtext_path
311 elif isinstance(marker, Hashable) and marker in self.markers:
312 self._marker_function = getattr(self, '_set_' + self.markers[marker])
313 elif (isinstance(marker, np.ndarray) and marker.ndim == 2 and
314 marker.shape[1] == 2):
315 self._marker_function = self._set_vertices
316 elif isinstance(marker, Path):
317 self._marker_function = self._set_path_marker
318 elif (isinstance(marker, Sized) and len(marker) in (2, 3) and
319 marker[1] in (0, 1, 2)):
320 self._marker_function = self._set_tuple_marker
321 elif isinstance(marker, MarkerStyle):
322 self.__dict__ = copy.deepcopy(marker.__dict__)
323 else:
324 try:
325 Path(marker)
326 self._marker_function = self._set_vertices
327 except ValueError as err:
328 raise ValueError(
329 f'Unrecognized marker style {marker!r}') from err
330
331 if not isinstance(marker, MarkerStyle):
332 self._marker = marker
333 self._recache()
334
335 def get_path(self):
336 """

Callers 1

__init__Method · 0.95

Calls 3

_recacheMethod · 0.95
PathClass · 0.85
deepcopyMethod · 0.80

Tested by

no test coverage detected