Чтобы масштабировать объект Bbox на скаляр, вы можете использовать преобразование Affine2D. Вот как это можно сделать:
scale_bbox.py
# Example scale factor
scale = 300.0
# Create an example bbox
bbox = Bbox.from_bounds(0, 0, 1, 1)
# Create the scale transformation
import matplotlib.transforms as transforms
scale_transform = transforms.Affine2D().scale(scale)
# Example usage
scaled_bbox = bbox.transformed(scale_transform)
Check out similar posts by category:
MatPlotLib Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow