Prev: - | Next: Basic plotting with 'plot'
matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2*np.pi, 100);
y = np.sin(x)
plt.plot(x, y)
plt.show()
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
x = np.linspace(0, 2*np.pi, 100);
y = np.sin(x)
plt.plot(x, y)
# No need to include 'plt.show()' command now
. Free learning material
. See full copyright and disclaimer notice