示例#1
0
    def set_marker(self, marker):
        if (iterable(marker) and len(marker) in (2, 3) and
            marker[1] in (0, 1, 2, 3)):
            self._marker_function = self._set_tuple_marker
        elif marker in self.markers:
            self._marker_function = getattr(
                self, '_set_' + self.markers[marker])
        elif is_string_like(marker) and is_math_text(marker):
            self._marker_function = self._set_mathtext_path
        elif isinstance(marker, Path):
            self._marker_function = self._set_path_marker
        else:
            try:
                path = Path(marker)
                self._marker_function = self._set_vertices
            except:
                raise ValueError('Unrecognized marker style %s' % marker)

        self._marker = marker
        self._recache()
示例#2
0
    def set_marker(self, marker):
        if iterable(marker) and len(marker) in (2, 3) and marker[1] in (0, 1, 2, 3):
            self._marker_function = self._set_tuple_marker
        elif isinstance(marker, np.ndarray):
            self._marker_function = self._set_vertices
        elif marker in self.markers:
            self._marker_function = getattr(self, "_set_" + self.markers[marker])
        elif is_string_like(marker) and is_math_text(marker):
            self._marker_function = self._set_mathtext_path
        elif isinstance(marker, Path):
            self._marker_function = self._set_path_marker
        else:
            try:
                Path(marker)
                self._marker_function = self._set_vertices
            except ValueError:
                raise ValueError("Unrecognized marker style {}".format(marker))

        self._marker = marker
        self._recache()