1
$\begingroup$

On the vertical axis of a Plot whenever I have a ratio of variables in a string as axes label, the exporting of the plot to PDF format messes this ratio up. Minimal working example:

Export["test.pdf", 
 Plot[0, {x, 0, 1}, 
  FrameLabel -> {"c", "\!\(\*FractionBox[\(a\), \(b\)]\)"}
 ]
]

This with Mathematica 10.0.2 produces the following image:

the ratio a/b is displayed problematic

Is there any way to resolve this issue where a/b is not shown correctly within the exported PDF by Mathematica?

$\endgroup$
  • $\begingroup$ I get the same with 10.0.2. Also when rewriting as DisplayForm@FractionBox["a", "b", Beveled -> False]. Ditto with Beveled->True. It looks like a bug $\endgroup$ – Mike Honeychurch Dec 17 '14 at 19:55
  • $\begingroup$ Is there maybe another way to display fractions in a useful and neat way? $\endgroup$ – Maikel Dec 18 '14 at 10:35
2
$\begingroup$

This may be a workaround :

Export["test.pdf", Plot[0, {x, 0, 1}, Frame -> True, FrameLabel -> {"c", ToString[\!\(\*FractionBox[\(a\), \(b\)]\)]}]]

Simply wrap ToString around and you will get the correct output. enter image description here

$\endgroup$
0
$\begingroup$

An easy way to fix this I found out is not using rotated labels on the y-axis using the command:

RotateLabel -> False

This does not solve the bug itself though.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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