matplotlib

Table Of Contents

Previous topic

lines

This Page

Markers

matplotlib.markers

This module contains functions to handle markers. Used by both the marker functionality of plot and scatter.

All possible markers are defined here:

marker description
”.” 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
TICKLEFT tickleft
TICKRIGHT tickright
TICKUP tickup
TICKDOWN tickdown
CARETLEFT caretleft
CARETRIGHT caretright
CARETUP caretup
CARETDOWN caretdown
“None” nothing
None nothing
” “ nothing
“” nothing
'$...$' render the string using mathtext.
verts a list of (x, y) pairs used for Path vertices.
path a Path instance.
(numsides, style, angle) see below

The marker can also be a tuple (numsides, style, angle), which will create a custom, regular symbol.

numsides:
the number of sides
style:

the style of the regular symbol:

Value Description
0 a regular polygon
1 a star-like symbol
2 an asterisk
3 a circle (numsides and angle is ignored)
angle:
the angle of rotation of the symbol, in degrees

For backward compatibility, the form (verts, 0) is also accepted, but it is equivalent to just verts for giving a raw set of vertices that define the shape.

class matplotlib.markers.MarkerStyle(marker=None, fillstyle=u'full')

Bases: object

MarkerStyle

Parameters:

marker : string or array_like, optional, default: None

See the descriptions of possible markers in the module docstring.

fillstyle : string, optional, default: ‘full’

‘full’, ‘left”, ‘right’, ‘bottom’, ‘top’, ‘none’

Attributes

markers
fillstyles
filled_markers
filled_markers = (u'o', u'v', u'^', u'<', u'>', u'8', u's', u'p', u'*', u'h', u'H', u'D', u'd')
fillstyles = (u'full', u'left', u'right', u'bottom', u'top', u'none')
get_alt_path()
get_alt_transform()
get_capstyle()
get_fillstyle()
get_joinstyle()
get_marker()
get_path()
get_snap_threshold()
get_transform()
is_filled()
markers = {0: u'tickleft', 1: u'tickright', 2: u'tickup', 3: u'tickdown', 4: u'caretleft', u'D': u'diamond', 6: u'caretup', 7: u'caretdown', u's': u'square', u'|': u'vline', u'': u'nothing', u'None': u'nothing', u'x': u'x', None: u'nothing', 5: u'caretright', u'_': u'hline', u'^': u'triangle_up', u' ': u'nothing', u'd': u'thin_diamond', u'h': u'hexagon1', u'+': u'plus', u'*': u'star', u',': u'pixel', u'o': u'circle', u'.': u'point', u'1': u'tri_down', u'p': u'pentagon', u'3': u'tri_left', u'2': u'tri_up', u'4': u'tri_right', u'H': u'hexagon2', u'v': u'triangle_down', u'8': u'octagon', u'<': u'triangle_left', u'>': u'triangle_right'}
set_fillstyle(fillstyle)

Sets fillstyle

Parameters:fillstyle : string amongst known fillstyles
set_marker(marker)