Created
April 4, 2020 11:16
-
-
Save yaojenkuo/aa6b352eedea84627eed664b13b2a0be to your computer and use it in GitHub Desktop.
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| x = np.linspace(0, 2*np.pi) | |
| y = np.sin(x) | |
| fig = plt.figure() | |
| ax = plt.axes() | |
| ax.plot(x, y) | |
| ax.set_title("$y = sin(x)$") | |
| ax.set_xlabel("x") | |
| ax.set_ylabel("y") | |
| ax.set_xticks([0, np.pi, 2*np.pi]) | |
| ax.set_xticklabels(['0', '$\pi$', '$2\pi$']) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment