3
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? enter image description here

RF_1
  • 672
  • 2
  • 7
  • 1
    Right click and using Trim Bounding Box – cvgmt Oct 10 '22 at 15:23
  • Thanks. What is the code for Trim Bounding Box instead of right click? Because I will export the figure via command Export – RF_1 Oct 10 '22 at 15:41
  • 1
    better to export to pdf and not png, as quality is better. You can import pdf as graphics to Latex. And For web browsing, you can always convert pdf images to svg using free tools, which is better than png. – Nasser Oct 10 '22 at 16:31
  • In fact, I want to export it .as .eps or pdf for LaTeX. But Mathematica doesn't give good results in 3D plots to get vector format (such as .eps or .pdf) while 2D plots are good. (Or I can' t achieve) – RF_1 Oct 10 '22 at 16:37

1 Answers1

5

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.

enter image description here


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]

Syed
  • 52,495
  • 4
  • 30
  • 85