Created
December 4, 2018 06:29
-
-
Save leewind/4ee5906293b581eeffab137fd56efc82 to your computer and use it in GitHub Desktop.
Create a simple plot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| # Data for plotting | |
| t = np.arange(0.0, 2.0, 0.01) | |
| s = 1 + np.sin(2 * np.pi * t) | |
| fig, ax = plt.subplots() | |
| ax.plot(t, s) | |
| ax.set(xlabel='time (s)', ylabel='voltage (mV)', | |
| title='About as simple as it gets, folks') | |
| ax.grid() | |
| fig.savefig("test.png") | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment