Last active
November 30, 2019 15:56
-
-
Save tkshnkmr/294aee7b237ef2e4e0b5d6794b3e4bce to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Input x, output y | |
x = np.linspace(0, 2*np.pi, 400) | |
y = np.sin(x**2) | |
# Creates fig and ax from subplots(). | |
# But only create a single plot | |
fig, ax = plt.subplots() | |
ax.plot(x, y) | |
ax.set_title('Subplot ex1: Only one plot') | |
# Save figure | |
fig.savefig('Subplot_ex1.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment