p1 = ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I},
PlotTheme -> "Detailed"]
Export["plot.png", p1]
When I export the plot, I have redundat spaces. How to reduce the spaces as optimal?

p1 = ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I},
PlotTheme -> "Detailed"]
Export["plot.png", p1]
When I export the plot, I have redundat spaces. How to reduce the spaces as optimal?

I tried borrowing a technique from 21031:
p2 = ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I},
PlotTheme -> "Detailed", Method -> {"ShrinkWrap" -> True}]
but that didn't change much.
Then I tried:
p3 = ImageCrop[Rasterize[p2, ImageResolution -> 300]]
Export["C:/plot3.png", p3]
which looks ok.
Without Rasterizing
Using SphericalRegion->False:
p4 = ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I},
PlotTheme -> "Detailed", SphericalRegion -> False]
Export["C:/plot.png", p4]
Method -> {"ShrinkWrap" -> True} combined with ImagePadding -> None works well.
– SnzFor16Min
Mar 20 '24 at 15:56
Trim Bounding Box– cvgmt Oct 10 '22 at 15:23Trim Bounding Boxinstead of right click? Because I will export the figure via commandExport– RF_1 Oct 10 '22 at 15:41