Introduction to NumPy and Matplotlib
Chapter 9: Matplotlib
Add a title
Task 2: Give yourself a title!
Now, add a title to the graph. Make the title 'My Graph'
.
See this official documentation for a hint on how to do this.
import numpy as np
import matplotlib.pyplot as plt
resolution = 1000
x = np.linspace(0, 50, resolution)
y = np.sin(x)
z = np.exp(y)
plt.figure(1)
plt.plot(x, y)
plt.title("My Graph")
plt.show()