python - Set Matplotlib colorbar size to match graph -


i cannot colorbar on imshow graphs 1 same height graph, short of using photoshop after fact. how heights match?example of colorbar size mismatch

you can matplotlib axisdivider.

the example linked page works without using subplots:

import matplotlib.pyplot plt mpl_toolkits.axes_grid1 import make_axes_locatable import numpy np  plt.figure() ax = plt.gca() im = ax.imshow(np.arange(100).reshape((10,10)))  # create axes on right side of ax. width of cax 5% # of ax , padding between cax , ax fixed @ 0.05 inch. divider = make_axes_locatable(ax) cax = divider.append_axes("right", size="5%", pad=0.05)  plt.colorbar(im, cax=cax) 

enter image description here


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -