2
$\begingroup$

How do I remove the background color from the drawn graphic? When I insert the Mathematica-derived plot image (.emf) into the Word, I always find a white background color. How do you make these background colors transparent?

$\endgroup$
  • $\begingroup$ I tried "Background→None" but it failed. $\endgroup$ – King.Max Jul 20 at 2:30
  • $\begingroup$ Did you put Background -> None in the Graphic itself, or in the export statement? I'm on macOS, so I can't use the .emf format, but I do get a transparent background with a PNG if I add the Background -> None to the actual export statement. Adding it to the graphic itself resulted in a white background. $\endgroup$ – MassDefect Jul 20 at 2:50
  • $\begingroup$ How are you exporting the graphic? $\endgroup$ – Carl Woll Jul 20 at 3:40
  • $\begingroup$ @MassDefect I just tried it, .png *can, but *.emf still has a white background $\endgroup$ – King.Max Jul 20 at 4:40
  • 1
    $\begingroup$ So if png works as expected, why not simply use this format. As far as I know, emf is a buggy format (at least it is not on the same level of maturity as other vector formats, e.g. pdf, eps,svg). $\endgroup$ – yarchik Jul 20 at 8:57
2
$\begingroup$

It is as simple as that for PNG files:

p = Plot[Sin[x], {x, 0, 1}];
Export["~/tmp/bgissue.png", p, Background -> None]

img

It works the same way for PDF. When I import the exported PDF graphics into Inkscape and put a colored background behind the object, one can clearly see this

img

If it indeed doesn't work for EMF (which I cannot try on Linux), one choice might be to use PDF.

$\endgroup$
  • $\begingroup$ I will give it a try, thank you $\endgroup$ – King.Max Jul 20 at 11:45
  • $\begingroup$ However, the pdf file does not seem to be inserted into the word, and the png file is not in vector format and will be distorted when zoomed in. $\endgroup$ – King.Max Jul 20 at 12:40
  • $\begingroup$ @King.Max Long live Microsoft Word. Can't you convert the PDF into an EMF somehow? $\endgroup$ – halirutan Jul 20 at 15:43

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.