11
$\begingroup$

Mathematica has a bug in that BarCharts and ListPlots with Filling will export as a pixelated bitmap, not a vector graphic when exporting as EMF format.

There is a workaround, which is to set ImageResolution to be 1300 or higher in the Export command, like this:

testdata = RandomReal[{5, 10}, 20];
bg1 = BarChart[{testdata}]
Export["bg1400.emf", bg1, ImageResolution -> 1400]

(No, you don't get a huge file if you set ImageResolution this high. It somehow tricks it into using vector graphics. However the workaround is a bit unreliable, depending on the graph in question.)

How can I make this option the default? SetOptions[Export]={ImageResolution -> 1400} produces an error message that it's not a recognised option to Export. I also tried:

SetOptions[$FrontEndSession, ConversionOptions -> {"ExportOptions" -> {"EMF" -> 
  {"IncludeSpecialFonts" -> True, ImageResolution -> 1400}}}]

But that doesn't seem to do anything.

How do I set these export options as the default, e.g. in a package? Alternatively, how do I force this hidden vector capability?

$\endgroup$
7
  • 5
    $\begingroup$ Yet another bug that remains unfixed in new versions. $\endgroup$ Commented Aug 28, 2013 at 4:46
  • $\begingroup$ related mathematica.stackexchange.com/questions/15272/… $\endgroup$
    – Jonie
    Commented Aug 28, 2013 at 5:25
  • $\begingroup$ Why don't you just Export to SVG and then use Inkscape (seems to be possible to use the command line) to convert to EMF? I tried it, seems to work fine. Don't ever wait for WRI to fix Export/Import issues. It seems to be much more important to do new stuff than to fix old stuff (which is understandable of course). $\endgroup$ Commented Aug 28, 2013 at 13:57
  • $\begingroup$ @RolfMertig because it won't be me doing it. It will be end users expecting the process to be at least as straightforward as the process they are currently using. If I can't deliver that, user acceptance could be affected. $\endgroup$
    – Verbeia
    Commented Aug 28, 2013 at 20:41
  • $\begingroup$ I've got this same problem and see your related post here: stackoverflow.com/questions/7396898/…. I've been chasing this like a dog after a bone and thought I'd share my research. @RolfMertig I took your advice without luck. Here is the image exported as a SVG imgur.com/GSyROEL and here it is imgur.com/awdU54t after the Inkscape command to convert it "C:\Program Files\Inkscape\inkscape.exe" "C:\Temp\aGraph.svg" --export-emf=svgToEMFFormat.emf. - any other peoples suggestions much appreciated! $\endgroup$
    – WolframFan
    Commented Feb 28, 2014 at 11:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.