# Is ExportString defective in V11?

Mathematica doesn't do the best job of exporting figures with shading or transparency to vector graphics formats such as PDF.

A common trick employed here and elsewhere on the web to workaround this is to rasterize just the image portion of the figure and insert this back into a vector version of the axes, labels etc.

The axes are typically converted to a vector drawing by the command:

ImportString[ExportString[axes, "EPS"]]


However this appears to no longer work on V11. More specifically I'm not sure ExportString[axes, "EPS"]] is behaving as it should, certainly it's output is very different between V10 and V11.

Complete test case:

fig = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]
axes = Graphics3D[{}, AbsoluteOptions[fig]]
ExportString[axes, "EPS"]


Outputs at pastebin:

The V10 output is all understandable and can be correctly imported via ImportString in both V10 and V11. However the V11 output contains what looks to be compressed data in the form

...g&[ie9oJbc5;SLF=49tG:f #EsI8)63Mg(KS!"/5i2neP :F"d@<>E99o

and cannot be imported by either V10 or V11.

So, am I missing something or is ExportString[...,"EPS"] not working correctly in V11?

If so, what is a suitable workaround?

EDITS

Note also that simply exporting to an EPS figure via Export also does not produce a vector image.

The option "AllowRasterization -> False" does not help for either Export or ExportString however setting it to True results in an even more coarsely rasterized image!

Screenshot of a section of the V11 output to show formatting:

• Dunno a workaround, but I'm for marking this as a bug. – Pillsy Mar 1 '17 at 15:37
• Having spoken to Wolfram this is now a known issue, introduced in 10.4 and persisting to 11. – Quantum_Oli Mar 8 '17 at 20:19
• OK, let's make it a bug then. – Pillsy Mar 9 '17 at 14:17
• are all the backslashes terminating the line ends really in the mathematica string? There are two issues here, one the result is rasterized, two the result is corrupted by being wrapped to 70 columns. The backslash is not valid postscript. That may have happened on upload to pastebin though. – george2079 Mar 9 '17 at 14:56
• Jens' workaround works in version 11.0.1: ImportString[ExportString[Graphics[Inset[axes,Automatic,Automatic,Scaled[1]]],"PDF"],"PDF"]. But for "EPS" it kills the system taking all available physical memory (more than 6 GB before I killed Mathematica.exe)... – Alexey Popkov Mar 9 '17 at 21:11