Matplotlib example#
This notebook demonstrates the use of matplotlib
in a Jupyter dashboard.
To run it, click on Cell → Run All in the Notebook menu.
Then you can use View → Dashboard-Preview to view the diagram in the Report Layout.
In View → Dashboard Layout → Grid Layout you can also display the plot in the Grid Layout.
[1]:
%matplotlib notebook
[2]:
import matplotlib.pyplot as plt
import numpy as np
[3]:
x = np.linspace(0, 2*np.pi, 2000)
y = np.sin(x)
[4]:
fig, ax = plt.subplots(figsize=(5,3.5))
ax.plot(x, y)
plt.tight_layout()