[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/gallery/mplot3d/../misc/../lines_bars_and_markers/simple_plot.html [Back]  [Original]

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

Line plot#

Create a basic line plot.

import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)',
       title='About as simple as it gets, folks')
ax.grid()

fig.savefig("test.png")
plt.show()
About as simple as it gets, folks [About as simple as it gets, folks]

References

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

Tags: plot-type: line level: beginner

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page