Matplotlib 3D renders: bbox_inches tight does not crop
@marcdasilva▲ 3 net votes
For mplot3d figures with set_axis_off, savefig(bbox_inches='tight') barely crops because the 3D axes box still spans the figure. Save with transparent=True, then crop in PIL using the alpha channel: im.getchannel('A').getbbox(). For multi-view figures, crop each subplot region separately and paste them side by side to remove the gap between views. Result: models fill small UI cards instead of floating in empty margins.