Basic plot#

A basic plot using the The implicit "pyplot" interface.

  • plot plots the data y versus x as lines and/or markers.

  • title, xlabel and ylabel set the title, x-axis label and y-axis label.

  • show displays the plot.

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0.0, 2.0, 0.01)
y = np.sin(2 * np.pi * x)

plt.plot(x, y)
plt.title("A basic plot using pyplot")
plt.xlabel('Time [s]')
plt.ylabel('Voltage [mV]')
plt.show()
A basic plot using pyplot

References

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

Gallery generated by Sphinx-Gallery