0
$\begingroup$

I'm on version 11.2 and using Windows 10. Here is some data and a histogram of it with log scaled heights.

data = RandomVariate[NormalDistribution[0, 1], 1000];
histogram = Histogram[data, Automatic, {"Log", "Count"}]

enter image description here

Exporting it as PDF causes the ticks to revert back to linear scaling.

Export["histogram.pdf",histogram];
SystemOpen@%

enter image description here

Is there a way to export to PDF while keeping the logarithmic height scaling, other than upgrading to a later version? Notice that logarithmic bin width specification used to suffer from the same problem but has at some point been fixed, and at least in version 13.3 this one has been too.

$\endgroup$
6
  • 1
    $\begingroup$ works for me. V 13.3 on windows 10. !Mathematica graphics You should always indicate the version you are using and the OS. $\endgroup$
    – Nasser
    Commented Jul 25, 2023 at 8:34
  • $\begingroup$ This looks like a duplicate of Plot of a histogram is exported with wrong ticks if log-transformed data are used $\endgroup$
    – Jason B.
    Commented Jul 25, 2023 at 18:24
  • $\begingroup$ @JasonB. See the last paragraph, it is not. The question is even linked. $\endgroup$
    – Kiro
    Commented Jul 27, 2023 at 8:09
  • $\begingroup$ It looks like the same bug to me, and it has been fixed in the most recent version of the software. $\endgroup$
    – Jason B.
    Commented Jul 27, 2023 at 13:17
  • 1
    $\begingroup$ @Kiro - I'm sorry, I don't really have access to version 11.2 to check so I could definitely be wrong. I just read both questions as saying that a histogram created with log ticks display correctly in a notebook but incorrectly in the exported PDF, both posts explicitly state version 11.2, and both seem to work fine in the current version. One workaround is to take a screenshot snippet of the plot in the notebook and export that image as a pdf or paste it into another program to create the PDF. Not the greatest workaround, maybe better with notebook magnification set high. $\endgroup$
    – Jason B.
    Commented Jul 27, 2023 at 21:06

0

Your Answer

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