Skip to content

Informatics Practices · Ch 4 — Plotting Data using Matplotlib

Marker

4.3.1

Marker

A marker is a symbol that represents a single data value on a chart. In a line plot, by default, only the line connecting the points is drawn. However, you can make each data point visible by specifying a marker. This is done by passing the marker parameter to the plot() function.

The marker parameter accepts a short string code. For example, to mark each point with a circle, you would write marker='o'. The table below lists the marker symbols available in Matplotlib, along with their string codes and descriptions.

Marker SymbolDescriptionMarker SymbolDescription
.Point8Octagon
,PixelsSquare
oCirclepPentagon
vTriangle downPPlus (filled)
^Triangle up*Star
<Triangle lefthHexagon1
>Triangle rightHHexagon2
1Tri down+Plus
2Tri upxX
Table 4.3Some of the Matplotlib Markers
MarkerDescriptionMarkerDescription
"."Point"8"octagon
","Pixel"s"square
"o"Circle"p"pentagon
"v"triangle_down"P"plus (filled)
"^"triangle_up"*"star
"<"triangle_left"h"hexagon1
">"triangle_right"H"hexagon2
"1"tri_down"+"plus