I have a Mathematica installation on a Linux server that is intended to be used for batch processing. Some of the things that will be processed will include rendering of graphics. However, if I use Export["/file/name.gif", graphicsobject]
, Mathematica wants to connect to an X server.
Yes, I can run Xvfb or similar, but this seems like inordinate overkill. Is this really the only option? Is there no way to get Mathematica to render to GIF (or PNG, or BMP, or TIFF, or whatever; I don't really care) without having an X server running?
Update:
I just ran this small program without an X server available:
s=Graphics[Sphere[]];
Do[
Print[fmt];
TimeConstrained[
Export["/tmp/img-"<>fmt, s, fmt],
10, Print["Timeout"] ],
{fmt, $ExportFormats} ]
and found that the only files created that contained something other than just the text Graphics[Sphere[0, 0, 0]]
or -Graphics-
were DXF and JVX, both of which were very simple renderings without axes or labels or anything once anything remotely more complex was rendered.
Export[]
ing PostScript seems to require an X server as well. Is there another way to generate PS? AndRasterize[]
requires the X server. $\endgroup$Export["/tmp/circle.eps", Graphics[Circle[]]]
is simple enough, still no joy. $\endgroup$