Basic numerics and plotting with PythonΒΆ

A simple example of basic Python numerics and how to plot it.

../_images/plot_python_101_001.png

Python source code: plot_python_101.py

# import numpy: the module providing numerical arrays
import numpy as np
t = np.linspace(1, 10, 2000)

# import matplotlib.pyplot: the module for scientific plotting
import matplotlib.pyplot as plt
plt.plot(t, np.cos(t))

Total running time of the example: 0.27 seconds ( 0 minutes 0.27 seconds)