Re: Question: Plots via command-line using front-end fonts?
- To: mathgroup at smc.vnet.net
- Subject: [mg73691] Re: Question: Plots via command-line using front-end fonts?
- From: Rolf.Mertig at gmail.com
- Date: Sat, 24 Feb 2007 02:29:01 -0500 (EST)
- References: <ergqdv$iud$1@smc.vnet.net>
Hi,
here is one possibilitiy which I tested on openSUSE Linux, with
Mathematica 5.2:
(* run this file (back.m) on Linux, e.g., from a command shell as:
math < back.m > back.out &
*)
(*
**********************************************************************
*)
$start=AbsoluteTime[];
Needs["JLink`"];
(* the JLink function UseFrontEnd is needed: *)
JLink`UseFrontEnd[
(* we do not want to see the plot on screen: *)
Block[{$DisplayFunction=Identity},
(* use fonts and settings from the FrontEnd *)
pl = Plot3D[Sin[y]*Sin[x],{x, -3Pi, 3Pi}, {y,-5,5},
AxesLabel->{\[Wolf], \[Beta],""},
PlotLabel -> StyleForm[TraditionalForm[Sin[\[Wolf]]*Sin[\
[Beta]]],
"Section"],
PlotPoints->200, Mesh->False];
];
(* export it as EPS *)
Export["plot.eps", pl, "EPS"]
];
Print["wall-clock time needed = ", AbsoluteTime[]-
$start];
(*
**********************************************************************
*)
Regards,
Rolf Mertig
GluonVision GmbH, Berlin
http://www.gluonvision.com
On 21 Feb., 07:55, "oshaughn" <oshau... at northwestern.edu> wrote:
> Hello,
>
> I'd like to generate plots noninteractively (e.g., from a makefile,
> possibly on a remote machine). While my math kernel will definitely
> produce and export EPS files (e.g., pl = Plot[...]; Export[fname, pl,
> "EPS"];), some fonts are apparently not available through the kernel
> and are handled by the front end.
>
> So I have two questions:
>
> (1) can the kernel be made aware of the other fonts that the front end
> uses, or
>
> (2) can the front end be run *noninteractively* to produce and export
> plots, or
>
> Any thoughts would be much appreciated!