4
$\begingroup$

When we use Background-> None in plot options, and export the plot for example as a PNG format, but we have a plot with a white background when we insert in a software as Powerpoint. How can we export a plot without any background?

$\endgroup$

3 Answers 3

6
$\begingroup$

Use the option Background->None in your Export call:

file = Export["tst1.png", Graphics[Circle[]], "PNG", Background->None];

Style[Import[file], Background->LightBlue]

enter image description here

$\endgroup$
5
$\begingroup$
myfig = RemoveBackground[Graphics[Plot[Sin[x], {x, 0, 10}]]];

Export["/.../myfig.png", myfig, "PNG"]
$\endgroup$
1
  • $\begingroup$ FWIW: this works with Mathematica 11.0 on a Mac running Mojave. @b3m2a1 's answer, unfortunately, still produces a white background. $\endgroup$ Commented Oct 22, 2019 at 16:01
1
$\begingroup$

Here's the way I tend to do it:

Export[
 "path/to/file/asd.png",
 Rasterize[
   Plot[Sin[x], {x, 0, 10},
     Background -> None
     ],
  Background -> None
  ]
 ]
$\endgroup$
2
  • 1
    $\begingroup$ I think this cannot work!! $\endgroup$ Commented Feb 6, 2018 at 19:02
  • $\begingroup$ @Irreversible If it can't that's news to me. It works on my Mac. $\endgroup$
    – b3m2a1
    Commented Feb 6, 2018 at 20:59

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.