Re: plot in new page with mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg38429] Re: [mg38276] plot in new page with mathematica
- From: Omega Consulting <info at omegaconsultinggroup.com>
- Date: Sat, 14 Dec 2002 03:20:56 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
At 03:17 AM 12/10/2002, simon pilette wrote:
>at school the command plot makes mathematica open
>a new page witch contains the graphics but it dont seems to
>be a preset of mathematica so my question is how can I
>configure mathematica to make im plot my grapchics in new page
>
>thank
>s.
To set the default action for graphics, you set $DisplayFunction. The
function takes a single argument, the graphics expression. For example,
In[1]:=
PrintShort[gr_] := Print[Short[InputForm[gr]]]
In[2]:=
$DisplayFunction = PrintShort;
In[3]:=
Plot[x^2,{x,0,10}]
Graphics[{{Line[<<1>>]}}, " ? "nge -> Automatic, <<24>>}]
Note that there's no output in this example, so it's a good idea to have
your function return the original expression.
The second part is learning how to put a graphic into a new notebook. This
can be done with DisplayString and NotebookPut.
In[4]:=
PutToNewNB[gr_] :=
(NotebookPut[
Notebook[{
Cell[GraphicsData["PostScript", DisplayString[gr]],"Graphics",
ImageMargins->{{0,0},{0,0}}]
},WindowSize->{FitAll, FitAll},
WindowElements->{},WindowFrameElements->{"CloseBox"},
ShowCellBracket->False, Saveable->False]
]; gr)
In[5]:=
$DisplayFunction =PutToNewNB;
In[6]:=
Plot[x^2,{x,0,10}]
Out[6]=
-Graphics-
--------------------------------------------------------------
Omega Consulting
"The final answer to your Mathematica needs"