[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../gallery/ticks/../misc/../pyplots/pyplot_simple.html [Back]  [Original]

Basic plot — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

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 [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


Web Proxy Viewer  |  New URL  |  Original Page