def process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None):
 (bbox_inches, restore_bbox) = bbox_inches_restore
 restore_bbox()
 r = adjust_bbox(fig, bbox_inches, fixed_dpi)
 return (bbox_inches, r)

def process_figure_for_rasterizing ( fig , bbox_inches_restore , fixed_dpi = None ) : ( bbox_inches , restore_bbox ) = bbox_inches_restore restore_bbox ( ) r = adjust_bbox ( fig , bbox_inches , fixed_dpi ) return ( bbox_inches , r )
this need to be called when figure dpi changes during the drawing .