I've been showing off my fancy new graph formats to colleagues, but we have discovered that graphics based on BarChart
have jagged text when exported as EMF, WMF, PDF etc. Line graphs based on ListLinePlot
, DateListPlot
etc do not have this problem.
Short of Rasterize
-ing every Export
function automatically (it's for an application for end-users so they can't be expected to fiddle with it themselves), is there a workaround? It's a surprise because the documentation says:
Since EMF supports vector graphics, fonts are not rasterized when exporting to EMF.
EDIT If it's relevant, font used is Arial. This should give you something very close to the graph, except for the tickgrid business, which involves more custom functions than one would really want to wade through.
SetOptions[BarChart,Background->None, BaseStyle -> {20, FontFamily -> Rfont},
Frame -> True, FrameTicksStyle -> {{Directive[20, 20], 20}, {20, 20}},
FrameStyle ->
Directive[AbsoluteThickness[0.9], FontFamily -> Rfont, Black],
AspectRatio -> 14./19., PlotRangePadding -> None, Ticks -> None,
ChartBaseStyle -> EdgeForm[None], GridLinesStyle->Directive[GrayLevel[0.7],
AbsoluteThickness[0.9]], GridLines -> {None, Automatic},
ImageSize -> 672, ImageMargins -> {{0, 0}, {0, 3}},
ImagePadding -> {{66, 66}, {All, 1}}
]
SetOptions[ListPlot,Background->None,BaseStyle -> {20, FontFamily -> Rfont,
AbsolutePointSize[6]}, Frame -> True,
FrameStyle -> Directive[AbsoluteThickness[0.9], FontFamily -> "Arial", Black],
FrameTicksStyle -> {{Directive[20, 20], 20}, {20, 20}},
AspectRatio -> 14./19., GridLinesStyle->Directive[GrayLevel[0.7],
AbsoluteThickness[0.9]], GridLines -> {None, Automatic},PlotRangePadding->None,
ImageSize -> 672, ImageMargins -> {{0, 0}, {0, 3}},
ImagePadding -> {{66, 66}, {All, 1}}
];
areaharvested = {0.25, 1.25, 0.3, -0.1, -0.5, -0.5, -0.5, 0.25, 0.4};
yield = {3.25, 1.1, 2.6, 3., 2., -0.3, 2., 1.5, 1.2};
totalgrainprod = areaharvested + yield;
exgraph = Show[BarChart[Transpose@{areaharvested, yield}, ChartLayout -> "Stacked",
ChartStyle -> {Orange, Green}, PlotRange ->{{8.5, 9.5}, {-1, 4.}},
PlotRangePadding -> None,
FrameTicks ->{{myTickGrid[-1, 4, 1, "%"], myTickGrid[-1, 4, 1, "%"]},
{myBarChartTicks[{"67-71", "77-81", "87-91", "97-01", "07-11"}, 9], None}}],
ListPlot[totalgrainprod, PlotStyle -> AbsolutePointSize[13]]]
Export["exgraph.emf", exgraph]