From time to time, when I export plots with Mathematica, the labels have gray boxes as a rectangular background. I am using Mathematica 10.0.1 for Linux (gentoo) 64bit.
Consider this thing I again recently ran into:
b = 4;
n = 55;
datai = {#, PowerMod[b, #, n]} & /@ Range[1, 80];
p1 = ListPlot[datai, Frame -> True, Axes -> False, FrameLabel -> {"x", f(x)= 4^x (mod 55)"}, ImageSize -> 450, BaseStyle -> FontSize -> 17]
p2 = Grid[{{p1}}]
Export[NotebookDirectory[] <> "p1.pdf", p1];
Export[NotebookDirectory[] <> "p2.pdf", p2];
These are the results for p1
(top) and p2
(bottom):
I am not able to conclude in what situations I obtain thsese gray background boxes. "Luckily" I found out that it appears to be a workaround to wrap the plot into a Grid
. It seems to me that all plot commands I use List(Line)Plot
, (List)LogPlot
, (List)Plot
, (List)DensityPlot
, (List)ContourPlot
and maybe others are affected, regardless of the options. Also, it does not matter, whether I export as .pdf, .jpeg or .png (I guess also other formats are affected) or whether I use AllowRasterization
as an option for the plot command.
Can anyone reproduce this? Even better: Can anyone tell me what is going on? It is so easy to produce nice graphs with Mathematica, but they are usually destroyed after Export
, so that I moved over to exporting data and using pgfplots quite some time ago. But I got puzzled again and want to know what happens here...