def scale_figure(figure, dpi):
    """ Returns the caption and region bbox of a `figure` when scaled to `dpi` """
    rescaling = dpi/figure.dpi
    if figure.caption_bb is not None:
        caption_box = [x*rescaling for x in figure.caption_bb]
    else:
        caption_box = None
    if figure.region_bb is not None:
        region_box = [x*rescaling for x in figure.region_bb]
    else:
        region_box = None
    return caption_box, region_box