Skip to content

Instantly share code, notes, and snippets.

@naxty
Created February 14, 2017 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naxty/62a8ec1d014e0b53ae783416921fc818 to your computer and use it in GitHub Desktop.
Save naxty/62a8ec1d014e0b53ae783416921fc818 to your computer and use it in GitHub Desktop.
Multiple plots inside one graph
import matplotlib.pyplot as plt
f, (ax1, ax2) = plt.subplots(ncols=1, nrows=2, figsize=(24, 9))
f.tight_layout()
ax1.imshow(gradx, cmap='gray')
ax1.set_title('Gradx', fontsize=50)
ax2.imshow(grady, cmap='gray')
ax2.set_title('Grady', fontsize=50)
plt.subplots_adjust(left=0., right=1, top=0.9, bottom=0.)
f.savefig('grads.png') # save the figure to file
plt.close(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment