1
$\begingroup$

I'm exporting several images like

Export["path.pdf", fig, "PDF"]

The output, however, have the Automatic gray coloured tick labels changed to Black. This does not happen if I export in png, for instance.

How to export in pdf without altering the ticks labels style?

Edit: This is the Mathematica output:

enter image description here

This is the pdf output:

enter image description here

$\endgroup$
2
  • $\begingroup$ Perhaps you should show the .pdf file and the output as it appears in the notebook; it is hard to answer this question otherwise... Use a screenshot. $\endgroup$
    – mattiav27
    Jun 20, 2023 at 18:20
  • $\begingroup$ @mattiav27 edited! Thank you! $\endgroup$
    – GaloisFan
    Jun 20, 2023 at 19:41

1 Answer 1

2
$\begingroup$

Try to specify the FrameTicksStyle explicitly:

Plot[ Sin[x] , { x , 0 , 2 Pi}, Frame -> True, Axes -> None , 
 FrameTicksStyle -> Directive[Gray]]
Export[ "/tmp/1.pdf" , % , "PDF"]

Content of /tmp/1.pdf:

enter image description here

This worked for me with Mathematica 13.2.0 on Linux. Without FrameTicksStyle I was getting gray ticks inside the Mathematica frontend and black in the exported pdf.

$\endgroup$

Your Answer

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

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