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 Symbol | Description | Marker Symbol | Description |
|---|---|---|---|
. | 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 |
2 | Tri up | x | X |
Table 4.3Some of the Matplotlib Markers
| Marker | Description | Marker | Description |
|---|---|---|---|
| "." | 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 |