bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/Python/Data Science and Scientific Python
Python•Data Science and Scientific Python

Matplotlib Markers

Concept visual

Matplotlib Markers

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Markers

You can use the keyword argument marker to emphasize each point with a specified marker:

Example

Mark each point with a circle:

Formula

import matplotlib.pyplot as plt import numpy as np ypoints = np.array([3, 8, 1, 10])

plt.plot(ypoints, marker = 'o') plt.show()

Result:

Example

Mark each point with a star:... plt.plot(ypoints, marker = '*')...

Result:

Marker Reference

You can choose any of these markers:

Marker

Description

'o'

Circle

Try it » '*'

Star

Try it » '.'

Point

Try it » ','

Pixel

Try it » 'x' X Try it » 'X' X (filled) Try it » '+' Try it » 'P' Plus (filled) Try it » 's'

Square

Try it » 'D'

Diamond

Try it » 'd' Diamond (thin) Try it » 'p'

Pentagon

Try it » 'H'

Hexagon

Try it » 'h'

Hexagon

Try it » 'v'

Triangle Down

Try it » '^'

Triangle Up

Try it » '<'

Triangle Left

Try it » '>'

Triangle Right

Try it » '1'

Tri Down

Try it » '2'

Tri Up

Try it » '3'

Tri Left

Try it » '4'

Previous

Machine Learning - Percentiles

Next

Machine Learning - Data Distribution