def process_figure_for_rasterizing(figure, bbox_inches_restore, mode):
    '\n    This need to be called when figure dpi changes during the drawing\n    (e.g., rasterizing). It recovers the bbox and re-adjust it with\n    the new dpi.\n    '
    (bbox_inches, restore_bbox) = bbox_inches_restore
    restore_bbox()
    r = adjust_bbox(figure, mode, bbox_inches)
    return (bbox_inches, r)
This need to be called when figure dpi changes during the drawing
(e.g., rasterizing). It recovers the bbox and re-adjust it with
the new dpi.
def process_figure_for_rasterizing(figure, bbox_inches_restore, mode):
    '\n    This need to be called when figure dpi changes during the drawing\n    (e.g., rasterizing). It recovers the bbox and re-adjust it with\n    the new dpi.\n    '
    (bbox_inches, restore_bbox) = bbox_inches_restore
    restore_bbox()
    r = adjust_bbox(figure, mode, bbox_inches)
    return (bbox_inches, r)