12.3 Examples

With the option file=false (default value), the TeXgraph code is included in a user graphical element before being sent to the program TeXgraphCmd:



\begin{texgraph}[name=surf1,export=pgf]  
view(-7,7,-7,7), Marges(0,0,0,0),  
size(7.5), FillStyle:=full,  
FillColor:=lightblue,  
Dsurface( M(u,v,cos(u)+sin(v)),  
          -5+5*i,  
          -5+5*i, 25+25*i)  
\end{texgraph}

 PIC



Un exemple avec file=false

In that first example, the file that is really sent to the program is:

                      TeXgraph#  
                      Graph image = [  
                         view(-7,7,-7,7), Marges(0,0,0,0),  
                         size(7.5), FillStyle:=full,  
                         FillColor:=lightblue,  
                         Dsurface( M(u,v,cos(u)+sin(v)),  
                                   -5+5*i,  
                                   -5+5*i, 25+25*i)  
                         ];

With the option file=true, the TeXgraph code is considered as a source file for the program TeXgraphCmd:



\begin{texgraph}[name=polyedre,export=pgf,file]  
Cmd Marges(0,0,0,0); size(7.5);  
Include "PolyedresII.mac";  
Var A = M(3,0,0);  
Mac f = M(%1,%2,sin(%1)+cos(%2));  
Graph objet1 = [  
  background(full,lightgray),  
  ColorL:=slategray, StyleL:=12,  
  CubeAdc(Origin, A,C,T1,T2,Ar),  
  Build3D(C,T1,T2,Ar,  
     bdSurf(f(u,v),  
       [color:=steelblue,  
        u:=[-pi,pi],v:=u,  
        contrast:=0.125]),  
     bdAxes(Origin,  
       [color:=forestgreen,arrows:=1])  
     ),  
  Display3D()];  
\end{texgraph}

 PIC



One example with file=true