First page Back Continue Last page Overview Graphics

matplotlib in a program

import matplotlib.pyplot as plt

plt.plot([1,2,3,4])

plt.ylabel('some numbers')

plt.show()

This program can be started with

$ python3 simple_example.py

Assuming it has been saved as

simple_example.py

If the argument of plot is a simple list

or array, plot will use them as y values, the x values are the indices.