Last active
August 29, 2015 14:06
-
-
Save jklymak/637c7ffe0701dacb9f4f to your computer and use it in GitHub Desktop.
adjusting for colorbars
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 | |
| fig,ax=plt.subplots(2,1) | |
| pcm0=ax[0].pcolormesh(np.random.randn(20,30)) | |
| fig.colorbar(pcm0,ax=ax[0],shrink=0.75) | |
| pcm1=ax[1].pcolormesh(np.random.randn(20,30)) | |
| fig.colorbar(pcm1,ax=ax[1],shrink=0.75) | |
| # or if you want one beside a bunch, you can make a list to steal from: | |
| cax,kw = mpl.colorbar.make_axes([ax for ax in axs.flat],shrink=0.5) | |
| plt.colorbar(pcm, cax=cax, **kw) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment