A function that needs 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.
(fig, bbox_inches_restore, renderer, fixed_dpi=None)
| 71 | |
| 72 | |
| 73 | def process_figure_for_rasterizing(fig, bbox_inches_restore, renderer, fixed_dpi=None): |
| 74 | """ |
| 75 | A function that needs to be called when figure dpi changes during the |
| 76 | drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with |
| 77 | the new dpi. |
| 78 | """ |
| 79 | |
| 80 | bbox_inches, restore_bbox = bbox_inches_restore |
| 81 | restore_bbox() |
| 82 | r = adjust_bbox(fig, bbox_inches, renderer, fixed_dpi) |
| 83 | |
| 84 | return bbox_inches, r |
no test coverage detected
searching dependent graphs…