matplotlib.tight_bbox
注意
此模块被视为内部模块。
它的使用已被弃用,并将在未来版本中移除。
用于 Figure.savefig
中 bbox_inches 参数的辅助模块。
-
matplotlib._tight_bbox.adjust_bbox(fig, bbox_inches, fixed_dpi=None)[源代码][源代码]
暂时调整图像,以便仅保存指定区域(bbox_inches)。
它修改了 fig.bbox、fig.bbox_inches、fig.transFigure._boxout 和 fig.patch。虽然图形尺寸发生了变化,但原始图形的比例得到了保留。返回一个恢复原始值的函数。
-
matplotlib._tight_bbox.process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None)[源代码][源代码]
在绘图过程中(例如,光栅化),当图形的 dpi 发生变化时需要调用的函数。它会恢复 bbox 并根据新的 dpi 重新调整。