matplotlib.markers.MarkerStyle#

class matplotlib.markers.MarkerStyle(marker, fillstyle=None)[source]#

Bases: object

A class representing marker types.

Instances are immutable. If you need to change anything, create a new instance.

Attributes:
markerslist

All known markers.

filled_markerslist

All known filled markers. This is a subset of markers.

fillstyleslist

The supported fillstyles.

Parameters:
markerstr, array-like, Path, MarkerStyle, or None
  • Another instance of MarkerStyle copies the details of that marker.

  • None means no marker. This is the deprecated default.

  • For other possible marker values, see the module docstring matplotlib.markers.

fillstylestr, default: rcParams["markers.fillstyle"] (default: 'full')

One of 'full', 'left', 'right', 'bottom', 'top', 'none'.

transformtransforms.Transform, default: None

Transform that will be combined with the native transform of the marker.

capstyleCapStyle, default: None

Cap style that will override the default cap style of the marker.

joinstyleJoinStyle, default: None

Join style that will override the default join style of the marker.

filled_markers = ('o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')#
fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none')#
get_alt_path()[source]#

Return a Path for the alternate part of the marker.

For unfilled markers, this is None; for filled markers, this is the area to be drawn with markerfacecoloralt.

get_alt_transform()[source]#

Return the transform to be applied to the Path from MarkerStyle.get_alt_path().

get_capstyle()[source]#
get_fillstyle()[source]#
get_joinstyle()[source]#
get_marker()[source]#
get_path()[source]#

Return a Path for the primary part of the marker.

For unfilled markers this is the whole marker, for filled markers, this is the area to be drawn with markerfacecolor.

get_snap_threshold()[source]#
get_transform()[source]#

Return the transform to be applied to the Path from MarkerStyle.get_path().

get_user_transform()[source]#

Return user supplied part of marker transform.

is_filled()[source]#
markers = {'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle_down', '^': 'triangle_up', '<': 'triangle_left', '>': 'triangle_right', '1': 'tri_down', '2': 'tri_up', '3': 'tri_left', '4': 'tri_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin_diamond', '|': 'vline', '_': 'hline', 'P': 'plus_filled', 'X': 'x_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', 'none': 'nothing', ' ': 'nothing', '': 'nothing'}#
rotated(*, deg=None, rad=None)[source]#

Return a new version of this marker rotated by specified angle.

Parameters:
degfloat, default: None

Rotation angle in degrees.

radfloat, default: None

Rotation angle in radians.

.. note:: You must specify exactly one of deg or rad.
scaled(sx, sy=None)[source]#

Return new marker scaled by specified scale factors.

If sy is None, the same scale is applied in both the x- and y-directions.

Parameters:
sxfloat

X-direction scaling factor.

syfloat, default: None

Y-direction scaling factor.

transformed(transform: Affine2D)[source]#

Return a new version of this marker with the transform applied.

Parameters:
transformAffine2D, default: None

Transform will be combined with current user supplied transform.

Examples using matplotlib.markers.MarkerStyle#

Marker reference

Marker reference

Marker reference
Mapping marker properties to multivariate data

Mapping marker properties to multivariate data

Mapping marker properties to multivariate data