Version 3.1.2
matplotlib

Table of Contents

Related Topics

plot() format string

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

====================
plot() format string
====================

Use a format string (here, 'ro') to set the color and markers of a
`~matplotlib.axes.Axes.plot`.
"""

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [1, 4, 9, 16], 'ro')
plt.show()
Traceback (most recent call last):
  File "/build/matplotlib-tq5J6U/matplotlib-3.1.2/examples/pyplots/pyplot_formatstr.py", line 1
    ====================
    ^
SyntaxError: invalid syntax

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

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