Matplotlib Markers Module in Python

The Matplotlib.markers module provides functions to handle markers in Matplotlib. It is used both by the marker functionality of the plot and scatter.

Below is the table defining all possible markers in Matplotlib:

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
β€œP” plus (filled)
β€œ*” star
β€œh” hexagon1
β€œH” hexagon2
β€œ+” plus
β€œx” x
β€œX” x (filled)
β€œD” diamond
β€œd” thin_diamond
β€œ|” vline
β€œ_” hline
0 (TICKLEFT) tickleft
1 (TICKRIGHT) tickright
2 (TICKUP) tickup
3 (TICKDOWN) tickdown
4 (CARETLEFT) caretleft
5 (CARETRIGHT) caretright
6 (CARETUP) caretup
7 (CARETDOWN) caretdown
8 (CARETLEFTBASE) caretleft (centered at base)
9 (CARETRIGHTBASE) caretright (centered at base)
10 (CARETUPBASE) caretup (centered at base)
11 (CARETDOWNBASE) caretdown (centered at base)
β€œNone”, ” ” or β€œβ€ nothing
β€˜$…$’ Render the string using mathtext. E.g β€œ$r$” for marker showing the letter r.
verts A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0, 0) and the size is normalized, such that the created path is encapsulated inside the unit cell.
path A Path instance
(numsides, style, angle) The marker can also be a tuple (numsides, style, angle), which will create a custom, regular symbol. 
A) numsides: the number of sides
B) style: the style of the regular symbol, 
0: a regular polygon 
1: a star-like symbol 
2: an asterisk
C) angle: the angle of rotation of the symbol 

Note: It is important to note that the two lines of code below are equivalent, 

# line 1
plt.plot([1, 2, 3], marker = 9)

# line 2
plt.plot([1, 2, 3], marker = matplotlib.markers.CARETRIGHTBASE)

Matplotlib.markers module in Python

Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. The matplotlib.markers module provides a collection of marker styles used for data visualization in Matplotlib plots. These markers represent individual data points, enhancing clarity and distinction within graphs and charts.

Similar Reads

Matplotlib Markers Module in Python

The Matplotlib.markers module provides functions to handle markers in Matplotlib. It is used both by the marker functionality of the plot and scatter....

Python Matplotlib Markers Module Examples

Below are some examples of Matplotlib.markers module in Python:...