Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Mathematica has a bugbug 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 workaroundworkaround, 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?

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?

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?

edited tags
Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Added Windows tag because the EMF file format is windows specific and not supported on other platforms
Link
Jens
  • 97.9k
  • 7
  • 215
  • 510
Notice added Draw attention by Verbeia
Bounty Started worth 50 reputation by Verbeia
Tweeted twitter.com/#!/StackMma/status/373283001163341824
The workaround is unreliable
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225
Loading
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225
Loading