Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12809 > unrolled thread

Export graphics without notebook ( using .m file)

Started bybar@ANTYSPAM.ap.krakow.pl
First post2012-12-16 06:06 +0000
Last post2012-12-21 10:38 +0000
Articles 4 — 4 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Export graphics without notebook ( using .m file) bar@ANTYSPAM.ap.krakow.pl - 2012-12-16 06:06 +0000
    Re: Export graphics without notebook ( using .m file) <bar@robox.ii.up.krakow.pl> - 2012-12-20 08:20 +0000
    Re: Export graphics without notebook ( using .m file) "Alexey Popkov" <lehin.p@gmail.com> - 2012-12-21 10:38 +0000
    Re: Export graphics without notebook ( using .m file) awnl <awnl@gmx-topmail.de> - 2012-12-21 10:38 +0000

#12809 — Export graphics without notebook ( using .m file)

Frombar@ANTYSPAM.ap.krakow.pl
Date2012-12-16 06:06 +0000
SubjectExport graphics without notebook ( using .m file)
Message-ID<kajode$ilu$1@smc.vnet.net>
Hello, 
It is example from help:
---------------
div[{vx_, vy_}] := D[vx, x] + D[vy, y]; 
vf = {Cos[x + y^3], Sin[y + x^3]}; 
fig = StreamDensityPlot[Evaluate[{vf, div[vf]}], {x, -3, 3}, 
    {y, -3, 3}, StreamPoints -> Fine, StreamScale -> Large, 
    ColorFunction -> "Rainbow", MaxRecursion -> 2, 
    LightingAngle -> Automatic, StreamStyle -> Black]; 
Export["tt.jpg", fig];
---------------

The question is:

Why this works fine inside Mathematica notebook
and doesnt work as a script ?

math < example.m

generates tt.jpg file but not identical as from notebook ?

Version: Mathematica 7.0 


Olaf, 



[toc] | [next] | [standalone]


#12887

From<bar@robox.ii.up.krakow.pl>
Date2012-12-20 08:20 +0000
Message-ID<kauhp8$isi$1@smc.vnet.net>
In reply to#12809
bar@antyspam.ap.krakow.pl wrote:
Hello , can someone help me ?
I have very long calculation and it isn't possible to keep 
mathematica notebook session so long, 
I have to run it as batch file in background on the server ....

Olaf 



> Hello, 
> It is example from help:
> ---------------
> div[{vx_, vy_}] := D[vx, x] + D[vy, y]; 
> vf = {Cos[x + y^3], Sin[y + x^3]}; 
> fig = StreamDensityPlot[Evaluate[{vf, div[vf]}], {x, -3, 3}, 
>    {y, -3, 3}, StreamPoints -> Fine, StreamScale -> Large, 
>    ColorFunction -> "Rainbow", MaxRecursion -> 2, 
>    LightingAngle -> Automatic, StreamStyle -> Black]; 
> Export["tt.jpg", fig];
> ---------------
> 
> The question is:
> 
> Why this works fine inside Mathematica notebook
> and doesnt work as a script ?
> 
> math < example.m
> 
> generates tt.jpg file but not identical as from notebook ?
> 
> Version: Mathematica 7.0 
> 
> 
> Olaf, 
> 
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#12913

From"Alexey Popkov" <lehin.p@gmail.com>
Date2012-12-21 10:38 +0000
Message-ID<kb1e6f$ov1$1@smc.vnet.net>
In reply to#12809
Hi Olaf,

It does not work without the FrontEnd because the latter is necessary for 
rendering Mathematica's graphics. But it is still possible to run the FrontEnd from the script. Look at such functions as UsingFrontEnd, FrontEndExecute, 
$FrontEnd etc...

HTH,
Alexey


<bar@ANTYSPAM.ap.krakow.pl> wrote: news:kajode$ilu$1@smc.vnet.net...
> Hello,
> It is example from help:
> ---------------
> div[{vx_, vy_}] := D[vx, x] + D[vy, y];
> vf = {Cos[x + y^3], Sin[y + x^3]};
> fig = StreamDensityPlot[Evaluate[{vf, div[vf]}], {x, -3, 3},
>    {y, -3, 3}, StreamPoints -> Fine, StreamScale -> Large,
>    ColorFunction -> "Rainbow", MaxRecursion -> 2,
>    LightingAngle -> Automatic, StreamStyle -> Black];
> Export["tt.jpg", fig];
> ---------------
>
> The question is:
>
> Why this works fine inside Mathematica notebook
> and doesnt work as a script ?
>
> math < example.m
>
> generates tt.jpg file but not identical as from notebook ?
>
> Version: Mathematica 7.0
>
>
> Olaf,
>
>
>
> 


[toc] | [prev] | [next] | [standalone]


#12916

Fromawnl <awnl@gmx-topmail.de>
Date2012-12-21 10:38 +0000
Message-ID<kb1e7d$ovl$1@smc.vnet.net>
In reply to#12809
Hi,

> It is example from help:
> ---------------
> div[{vx_, vy_}] := D[vx, x] + D[vy, y];
> vf = {Cos[x + y^3], Sin[y + x^3]};
> fig = StreamDensityPlot[Evaluate[{vf, div[vf]}], {x, -3, 3},
>      {y, -3, 3}, StreamPoints -> Fine, StreamScale -> Large,
>      ColorFunction -> "Rainbow", MaxRecursion -> 2,
>      LightingAngle -> Automatic, StreamStyle -> Black];
> Export["tt.jpg", fig];
> ---------------
> 
> The question is:
> 
> Why this works fine inside Mathematica notebook
> and doesnt work as a script ?
> 
> math < example.m
> 
> generates tt.jpg file but not identical as from notebook ?
> 

I think rendering graphics and exporting needs a frontend. 
>From a batch job you can use the function UsingFrontEnd to 
run these functions. See the reference page in the help 
browser for more details: ref/UsingFrontEnd 

Depending on how you start your job you might need to provide 
some prerequisites: on a linux machine you typically need 
an X-server running for the frontend. Here: 
<http://reference.wolfram.com/legacy/v8/webMathematica/tutoria/InstallationXWindows.html#3537196>
is some documentation how to set this up for WebMathematica with 
e.g. Xvnc or vncserver which you basically can also use for a 
batch job started from a terminal session or a cron job...

hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web