def colorbar(fig, ax, im,<EOL>width=<NUM_LIT>,<EOL>height=<NUM_LIT:1.0>,<EOL>hoffset=<NUM_LIT>,<EOL>voffset=<NUM_LIT:0.0>,<EOL>orientation='<STR_LIT>'):
rect = np.array(ax.get_position().bounds)<EOL>rect = np.array(ax.get_position().bounds)<EOL>caxrect = [<NUM_LIT:0>]*<NUM_LIT:4><EOL>caxrect[<NUM_LIT:0>] = rect[<NUM_LIT:0>] + rect[<NUM_LIT:2>] + hoffset*rect[<NUM_LIT:2>]<EOL>caxrect[<NUM_LIT:1>] = rect[<NUM_LIT:1>] + voffset*rect[<NUM_LIT:3>]<EOL>caxrect[<NUM_LIT:2>] = rect[<NUM_LIT:2>]*width<EOL>caxrect[<NUM_LIT:3>] = rect[<NUM_LIT:3>]*height<EOL>cax = fig.add_axes(caxrect)<EOL>cb = fig.colorbar(im, cax=cax, orientation=orientation)<EOL>return cb<EOL>
draw colorbar without resizing the axes object to make room

kwargs:
::
    fig : matplotlib.figure.Figure
    ax : matplotlib.axes.AxesSubplot
    im : matplotlib.image.AxesImage
    width : float, colorbar width in fraction of ax width
    height : float, colorbar height in fraction of ax height
    hoffset : float, horizontal spacing to main axes in fraction of width
    voffset : float, vertical spacing to main axis in fraction of height
    orientation : str, 'horizontal' or 'vertical'

return:
::
    object : colorbar handle