You are reading an old version of the documentation (v3.1.1). For the latest version see https://matplotlib.org/stable/gallery/pyplots/pyplot_formatstr.html
Version 3.1.2
matplotlib
Fork me on GitHub

Table of Contents

Related Topics

plot() format string

Use a format string (here, 'ro') to set the color and markers of a plot.

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [1, 4, 9, 16], 'ro')
plt.show()
../../_images/sphx_glr_pyplot_formatstr_001.png

References

The use of the following functions, methods, classes and modules is shown in this example:

import matplotlib
matplotlib.pyplot.plot
matplotlib.axes.Axes.plot

Out:

<function Axes.plot at 0x7fb11b4499d8>

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery