Re: How to search mathgroup archives... or why does Export on linux need X?
- To: mathgroup at smc.vnet.net
- Subject: [mg117508] Re: How to search mathgroup archives... or why does Export on linux need X?
- From: John Fultz <jfultz at wolfram.com>
- Date: Mon, 21 Mar 2011 06:15:02 -0500 (EST)
The Mathematica front end is the only program capable of rendering Mathematica graphics(*), and the front end requires a windowing system to run. When you're running in the standalone kernel, a number of operations such as Export[] will automatically try to invoke a front end as a server process. The message you're seeing is the failure of the front end to launch when the kernel invokes it. Under Linux, it is possible to run the front end against a virtual server such as Xvfb or Xvnc. I won't say anything more about installing or configuring these programs (although the webMathematica documentation, available freely online, does discuss this a bit). But if you want to pursue this option, let me know and I can give you some pointers about how to configure their usage from within Mathematica. I don't have the information conveniently at my fingertips, but it's not difficult for me to dig it up if you need it. Incidentally, my preferred method for searching MathGroup is to go to groups.google.com, click "Advanced Groups Search" in the upper right-hand corner, and then doing a search constrained by setting the "Group" field to comp.soft-sys.math.mathematica. Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. (*) Prior to version 6, the kernel always rendered graphics into PostScript, and standalone exporters could be written because it merely required writing a renderer that understood a small subset of PostScript. That ability still exists somewhat in version 8, and can be accessed by executing "<<Version5`Graphics`". However, many of the visualizations generated by functionality newly added since version 6 are not supported by the legacy system. And I'm not sure that the matching legacy export systems have been maintained. On Sun, 20 Mar 2011 04:54:49 -0500 (EST), W. Craig Carter wrote: > Hello, > I believe that John Fultz answered a question like this on mathgroup > once, but I can't find it. Are there more clever ways to search the > archives? > > I am running mathematica in a script on a linux box. I construct a > graphic and then try to export it to a .tif or .pdf. The script hangs > with a: > "Xlib: connection to ":0.0" refused by server Xlib: No protocol > specified Can't open display ":0.0" and doesn't finish. > > ------- > For example, in script.m: > graphic = Plot[Sin[x],{x,0,1}]; > Export["temp.tif",graphic] > Quit[] > ----- > > ----- >> From shell: > path_to_math/math -script script.m > ------ > > Does anyone know of a work-around? > > Thanks, Craig