Python Matplotlib

Matplotlib Plotting

Basic plotting

Matplotlib Plotting

The plot() function is used to draw points (markers) in a diagram. By default, the plot() function draws a line from point to point.

Basic Plot

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]

plt.plot(x, y)
plt.show()