Skip to main content
Notice removed Draw attention by JeffDror
Bounty Ended with halirutan's answer chosen by JeffDror
added 295 characters in body
Source Link
JeffDror
  • 1.9k
  • 1
  • 14
  • 29

I am trying to output a simple plot with a legend and the output keeps coming out with a gray background. A simple example is the following:

Plot[{Sin[x], Cos[x]}, {x, 0, 2*3.14}, PlotStyle -> {Red, Blue}, 
PlotLegends -> SwatchLegend[{Red, Blue}, {"sin(x)", "cos(x)"}]]
Export["trig.pdf", %]

which outputs (notice the gray background!),

$\hspace{1cm}$enter image description here

I have tried setting "Background->White" in different places, but only managed to have certain regions to get a white background. How can I get an export the image with a white background (and keeping it in pdf format)?

I am using Mathematica V9 on Linux.

Edit:

  1. I just upgraded to V10 with hopes that it would fix the issue and the problem still persists.
  2. pdf and eps both show the gray background while image formats such as jpg don't. Oddly enough svg also doesn't show the gray background.
  3. I'm using Ubuntu 14.04 with Intel 4th generation graphics card.
  4. I tried using different pdf viewers and they all showed the same gray background.

I am trying to output a simple plot with a legend and the output keeps coming out with a gray background. A simple example is the following:

Plot[{Sin[x], Cos[x]}, {x, 0, 2*3.14}, PlotStyle -> {Red, Blue}, 
PlotLegends -> SwatchLegend[{Red, Blue}, {"sin(x)", "cos(x)"}]]
Export["trig.pdf", %]

which outputs (notice the gray background!),

$\hspace{1cm}$enter image description here

I have tried setting "Background->White" in different places, but only managed to have certain regions to get a white background. How can I get an export the image with a white background (and keeping it in pdf format)?

I am using Mathematica V9 on Linux.

I am trying to output a simple plot with a legend and the output keeps coming out with a gray background. A simple example is the following:

Plot[{Sin[x], Cos[x]}, {x, 0, 2*3.14}, PlotStyle -> {Red, Blue}, 
PlotLegends -> SwatchLegend[{Red, Blue}, {"sin(x)", "cos(x)"}]]
Export["trig.pdf", %]

which outputs (notice the gray background!),

$\hspace{1cm}$enter image description here

I have tried setting "Background->White" in different places, but only managed to have certain regions to get a white background. How can I get an export the image with a white background (and keeping it in pdf format)?

I am using Mathematica V9 on Linux.

Edit:

  1. I just upgraded to V10 with hopes that it would fix the issue and the problem still persists.
  2. pdf and eps both show the gray background while image formats such as jpg don't. Oddly enough svg also doesn't show the gray background.
  3. I'm using Ubuntu 14.04 with Intel 4th generation graphics card.
  4. I tried using different pdf viewers and they all showed the same gray background.
Notice added Draw attention by JeffDror
Bounty Started worth 50 reputation by JeffDror
Tweeted twitter.com/#!/StackMma/status/452084660391383040
Source Link
JeffDror
  • 1.9k
  • 1
  • 14
  • 29

Gray background in export pdf

I am trying to output a simple plot with a legend and the output keeps coming out with a gray background. A simple example is the following:

Plot[{Sin[x], Cos[x]}, {x, 0, 2*3.14}, PlotStyle -> {Red, Blue}, 
PlotLegends -> SwatchLegend[{Red, Blue}, {"sin(x)", "cos(x)"}]]
Export["trig.pdf", %]

which outputs (notice the gray background!),

$\hspace{1cm}$enter image description here

I have tried setting "Background->White" in different places, but only managed to have certain regions to get a white background. How can I get an export the image with a white background (and keeping it in pdf format)?

I am using Mathematica V9 on Linux.