more inset export problems
- To: mathgroup at smc.vnet.net
- Subject: [mg90224] more inset export problems
- From: "M.Roellig" <markus.roellig at googlemail.com>
- Date: Wed, 2 Jul 2008 05:34:05 -0400 (EDT)
Hi group, I am trying to produce publishable EPS versions of some of my plots. I am using Inset to produce customized legends and am running into problems once I am trying to export the plot to EPS (or PDF,...). Taking the follwoing example: ins2 = Graphics[ Inset[Framed@Grid[{{"A", "B"}, {"C", "D"}, {"E", "F"}}], Scaled[{0.3, 0.4}]]]; graph2 = Plot[Sin[x], {x, -1, 5}, Frame -> True, Axes -> False]; Show[graph2, ins2] So far everything looks fine, but after EPS export (either via Export selection as..., or via the Export command) the text in the legends is getting messed up. Looking at the test.eps will demonstrate what I mean: Export["test.eps", Show[graph2, ins2], "EPS"] In a message thread from Dec 2007 a workaround for this problem has been presented: ( http://groups.google.de/group/comp.soft-sys.math.mathematica/browse_thread/thread/8a6b372b039303ce/7a51d7a4da261401?lnk=gst&q=inset+problems#7a51d7a4da261401 ) (*record the old value of the PrintingStyleEnvironment option*) oldopts = Options[$FrontEnd, PrintingStyleEnvironment]; (*set the value to "Working"*) SetOptions[$FrontEnd, PrintingStyleEnvironment -> "Working"]; (*your export code here*) Export["test.eps", Show[graph2, ins2], "EPS"] (*reset the option to the original value*) SetOptions[$FrontEnd, oldopts]; This works, however, if I slightly increase complexity of the legend text EPS export again fails. Take for example: ins3 = Graphics[ Inset[Framed@ Grid[{{"\!\(\*FractionBox[\"A\", \"a\"]\)", "\!\(\*FractionBox[\"B\", \"b\"]\)"}, {"C", "D"}, {"\!\(\*FractionBox[ RowBox[{\"E\", \" \", RowBox[{\"(\", RowBox[{\"1\", \"-\", \"0\"}], \")\"}]}], RowBox[{\"e\", \" \", \"[\", RowBox[{\"2\", \"-\", \"1\"}], \"]\"}]]\)", "F"}}], Scaled[{0.5, 0.4}]]]; (I hope the cut&paste is working) Now exporting it and examining the EPS shows Mathematica's problems in EPS-Export (even if I adapt the PrintingStyleEnvironment like above: Export["test.eps", Show[graph2, ins2, ins3], "EPS"] Does anybody can give me an idea how to EPS export my legends properly? Thanks in advance Markus