def mpl_get_cb_bound_next_to_plot(ax):
position = ax.get_position()<EOL>figW, figH = ax.get_figure().get_size_inches()<EOL>fig_aspect = figH / figW<EOL>box_aspect = ax.get_data_ratio()<EOL>pb = position.frozen()<EOL>pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect).bounds<EOL>ax_size = ax.get_position().bounds<EOL>xdiff = (ax_size[<NUM_LIT:2>] - pb1[<NUM_LIT:2>]) / <NUM_LIT:2><EOL>ydiff = (ax_size[<NUM_LIT:3>] - pb1[<NUM_LIT:3>]) / <NUM_LIT:2><EOL>sizes = [ax_size[<NUM_LIT:0>] + xdiff + ax_size[<NUM_LIT:2>] + <NUM_LIT>,<EOL>ax_size[<NUM_LIT:1>] + ydiff, <NUM_LIT>, pb1[<NUM_LIT:3>]]<EOL>return sizes<EOL>
Return the coordinates for a colorbar axes next to the provided axes
object. Take into account the changes of the axes due to aspect ratio
settings.

Parts of this code are taken from the transforms.py file from matplotlib

Important: Use only AFTER fig.subplots_adjust(...)

Use as:
=======
cb_pos = mpl_get_cb_bound_next_to_plot(fig.axes[15])
ax1 = fig.add_axes(cb_pos, frame_on=True)

cmap = mpl.cm.jet_r
norm = mpl.colors.Normalize(vmin=float(23), vmax=float(33))
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap, norm=norm,
                                orientation='vertical')
cb1.locator = mpl.ticker.FixedLocator([23,28,33])
cb1.update_ticks()
cb1.ax.artists.remove(cb1.outline)    # remove framei