Skip to main content
Albero Academy

Markers & Line Styles

Distinguish series with dashes, markers and widths — beyond colour alone.

Customizing Plots7 min

Colour isn't the only way to tell series apart. Line styles (dashed, dotted) and markers (circles, squares) add redundancy — vital for black-and-white printing and accessibility.

Styles & markers

ArgumentExamples
linestyle"-" solid, "--" dashed, ":" dotted, "-." dash-dot
marker"o" circle, "s" square, "^" triangle, "x", "*"
linewidthline thickness (points)
markersizemarker size (points)
combining them
ax.plot(x, y, linestyle="--", marker="o", linewidth=2, markersize=6)
# The shorthand format string: colour + marker + linestyle
ax.plot(x, y, "r--o") # red, dashed, circle markers

Key takeaways

  1. 01linestyle (-, --, :, -.) and marker (o, s, ^, x) distinguish series beyond colour.
  2. 02linewidth and markersize control thickness and point size.
  3. 03The format string "r--o" sets colour, linestyle and marker compactly.
  4. 04Combine colour + style for greyscale and colour-blind accessibility.

Finished this chapter?

Mark it complete to track your progress through Matplotlib.