1
$\begingroup$

I am trying to export a 3d plot of good quality. Here is a MWE:

ptest = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]
Export["test.pdf", 
 Rasterize[ptest, ImageResolution -> 100, Background -> White], 
 Frame -> False, FrameStyle -> White]

The problem is that after exporting there is a weird frame in the pdf file. It seems like there is some shade apparent in the bottom and right edge of the file. See the red arrow in the attached picture.

Does anyone know how to fix it?

enter image description here

My Mathematica version is

"12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)"

My Mac OS version is:

ProductName:    macOS
ProductVersion: 11.5.2
BuildVersion:   20G95

To see this issue better, here is a screenshot from a tex document: enter image description here

$\endgroup$
6
  • 2
    $\begingroup$ Welcome to the Mathematica Stack Exchange. Please run $Version and include version info along with your OS details. $\endgroup$
    – Syed
    Mar 29, 2022 at 13:15
  • $\begingroup$ I don't see the frame on MMA 12.0, macOS 10.14. $\endgroup$
    – N.J.Evans
    Mar 29, 2022 at 13:28
  • $\begingroup$ @N.J.Evans I am running macOS 11.5. Are you sure you don't see it? In my case I didn't see it straight away, but when I included the figure in a tex document it was very visible. $\endgroup$ Mar 29, 2022 at 13:39
  • 1
    $\begingroup$ I don't see it on MMA 13.0 $\endgroup$
    – lericr
    Mar 29, 2022 at 14:03
  • $\begingroup$ @bobsacameno I tried including it in a TeX document and it still looks fine. $\endgroup$
    – N.J.Evans
    Mar 29, 2022 at 14:34

1 Answer 1

0
$\begingroup$

The problem disappears when I changed the file suffix from pdf to png.

Namely using

ptest = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]
Export["test.png", 
 Rasterize[ptest, ImageResolution -> 100, Background -> White], 
 Frame -> False, FrameStyle -> White]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.