[BACK]Return to gnuplot.oxweave CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / doc

File: [local] / OpenXM / src / asir-contrib / packages / doc / Attic / gnuplot.oxweave (download)

Revision 1.5, Sat Dec 18 01:56:03 2004 UTC (19 years, 6 months ago) by takayama
Branch: MAIN
CVS Tags: RELEASE_1_2_3
Changes since 1.4: +137 -1 lines

Added a workaround for the old cygwin (mkfifo has not been implemented).
Manual entries for gnuplot.stop, gnuplot.setenv.

/* $OpenXM: OpenXM/src/asir-contrib/packages/doc/gnuplot.oxweave,v 1.5 2004/12/18 01:56:03 takayama Exp $ */


/*&C
@c DO NOT EDIT THIS FILE   oxgnuplot.texi
*/
/*&ja
@node GNUPLOT Functions,,, Top
@chapter GNUPLOT $BH!?t(B

$B$3$N@a$G$O(B GNUPLOT $B$N(B ox $B%5!<%P(B @code{ox_sm1_gnuplot}
$B$H$N%$%s%?%U%'!<%94X?t$r2r@b$9$k(B.
$B$3$l$i$N4X?t$O%U%!%$%k(B  @file{gnuplot} $B$GDj5A$5$l$F$$$k(B.
@code{gnuplot} $B$O(B
@file{$(OpenXM_HOME)/lib/asir-contrib/} $B$K$"$k(B.
*/
/*&en
@node GNUPLOT Functions,,, Top
@chapter GNUPLOT Functions

This chapter describes  interface functions for
GNUPLOT ox server @code{ox_sm1_gnuplot}.
These interface functions are defined in the file @code{gnuplot}.
The file @file{gnuplot} is at @*
@file{$(OpenXM_HOME)/lib/asir-contrib}.
*/
/*&C

@menu
* gnuplot.start::
* gnuplot::
* gnuplot.plot_dots::
* gnuplot.heat::
* gnuplot.plot_function::
* gnuplot.output::
* gnuplot.setenv::
* gnuplot.stop::
@end menu

*/
/*&C
@example
@include opening.texi
[255] gnuplot.start();
0
[257] gnuplot.gnuplot("plot sin(x**2);");
0
@end example
*/
/*&en
The function
@code{gnuplot.heat}(@var{dt},@var{step}) demonstrates our gnuplot interface.
It numerically solves the heat equation
@tex
$$   {{\partial u}\over{\partial t}} =  {{\partial^2 u}\over{\partial x^2}},
\quad u(t,0) = u(t,1) =1
$$
with the initial condition
$$  u(0,x) = x, \  (0 \leq x \leq 0.5), \quad
    u(1,x) = 1-x, \  (0.5 \leq x \leq 1)
$$
by the explicit scheme for $0 \leq t \leq \hbox{\it dt}*\hbox{\it step}$.
@end tex
The segment [0,1] is devided into @code{Heat_N} segments.
The static variable @code{Heat_N} can be set by the function
@code{gnuplot.heat_set_N}.
If the celebrated Courant-Friedrichs-Levi number
@var{dt}*@code{Heat_N}*@code{Heat_N} is less than or equal to 0.5,
then the explicit scheme is numerically stable.
One can observe the instability by changing CFL number.
@example
  gnuplot.heat_set_N(20); gnuplot.heat(0.001,30);   (CFL number is 0.4)
  gnuplot.heat_set_N(20); gnuplot.heat(0.003,30);   (CFL > 0.5 unstable)
@end example
*/
/*&ja
$B4X?t(B
@code{gnuplot.heat}(@var{dt},@var{step}) $B$O$o$l$o$l$N(B GNUPLOT $B%$%s%?%U%'!<%94X?t$N%G%b(B
$B$G$"$k(B.
$B$3$N4X?t$OG.EAF3J}Dx<0(B
@tex
$$   {{\partial u}\over{\partial t}} =  {{\partial^2 u}\over{\partial x^2}},
\quad u(t,0) = u(t,1) =1
$$
$B$r=i4|>r7o(B
$$  u(0,x) = x, \  (0 \leq x \leq 0.5), \quad
    u(1,x) = 1-x, \  (0.5 \leq x \leq 1)
$$
$B$GM[E*:9J,K!$rMQ$$$F(B
$B;~4V$,(B $0 \leq t \leq \hbox{\it dt}*\hbox{\it step}$ $B$NHO0O$G2r$/(B.
@end tex
$B6h4V(B [0,1] $B$O(B @code{Heat_N} $B8D$KJ,3d$5$l$k(B.
static $BJQ?t(B @code{Heat_N} $B$O(B
$B4X?t(B @code{gnuplot.set_heat_N} $B$G@_Dj$9$k(B.
$BM-L>$J(B Courant-Friedrichs-Levi $B?t(B
@var{dt}*@code{Heat_N}*@code{Heat_N} $B$,(B 0.5 $B0J2<$G$"$l$P(B,
$BM[E*:9J,%9%-!<%`$O0BDj$G$"$k(B.
CFL $B$rJQ$($k$3$H$K$h$j(B, $BIT0BDj@-$,@8$8$k$N$r4Q;!$G$-$k(B.
@example
  gnuplot.set_heat_N(20); gnuplot.heat(0.001,30);   (CFL number is 0.4)
  gnuplot.set_heat_N(20); gnuplot.heat(0.003,30);   (CFL > 0.5 unstable)
@end example
*/
/*&C
Author of @code{GNUPLOT}: Thomas Williams, Colin Kelley
*/

/*&ja
@section $BH!?t0lMw(B
*/ 
/*&en
@section Functions
*/ 
/*&ja
@node gnuplot.start,,, GNUPLOT Functions
@subsection @code{gnuplot.start}
@findex gnuplot.start
@table @t
@item gnuplot.start()
::  Localhost $B$G(B @code{ox_sm1_gnuplot} $B$r5/F0$9$k(B.
@end table

@table @var
@item return
$B@0?t(B
@end table

@itemize @bullet
@item Localhost $B$G(B @code{ox_sm1_gnuplot} $B$r5/F0$9$k(B.
    $B5/F0$5$l$?(B @code{ox_sm1_gnuplot} $B$N<1JLHV9f$rLa$9(B.
@item @code{Xm_noX =1} $B$H$7$F$*$/$H(B, @code{ox_sm1_gnuplot} $BMQ$N(B debug window $B$,3+$+$J$$(B.
@item $B<1JLHV9f$O(B, @code{Gnuplot_proc} $B$K3JG<$5$l$k(B.
@end itemize
*/
/*&en
@node gnuplot.start,,, GNUPLOT Functions
@subsection @code{gnuplot.start}
@findex gnuplot.start
@table @t
@item gnuplot.start()
::  Start  @code{ox_sm1_gnuplot} on the localhost.
@end table

@table @var
@item return
Integer
@end table

@itemize @bullet
@item Start @code{ox_sm1_gnuplot} on the localhost.
    It returns the descriptor of @code{ox_sm1_gnuplot}.
@item Set @code{Xm_noX = 1} to start @code{ox_sm1_gnuplot} without a debug window.
@item The descriptor is stored in @code{Gnuplot_proc}.
@end itemize
*/
/*&C
@example
P = gnuplot.start();
@end example
*/
/*&ja
@table @t
@item $B;2>H(B
@code{ox_launch}, @code{gnuplot}
@end table
*/
/*&en
@table @t
@item Reference
@code{ox_launch}, @code{gnuplot}
@end table
*/


/*&en
@node gnuplot,,, GNUPLOT Functions
@subsection @code{gnuplot}
@findex gnuplot
@table @t
@item gnuplot.gnuplot(@var{s}|proc=@var{p})
::  Ask GNUPLOT to execute the command string @var{s}.
@end table

@table @var
@item return
Void
@item p
Number
@item s
String
@end table

@itemize @bullet
@item
 The server executes the gnuplot command @var{s}.  
  When an error occurs,
  the gnuplot itself terminates and ox_sm1_gnuplot server automatically 
  restarts gnuplot.
@item
    gnuplot does not accept a long polynomial.
@item
    gnuplot does not accept @code{^}. Use @code{**} instead.
@end itemize
*/
/*&ja
@node gnuplot,,, GNUPLOT Functions
@subsection @code{gnuplot}
@findex gnuplot
@table @t
@item gnuplot.gnuplot(@var{s}|proc=@var{p})
::  GNUPLOT $B$K%3%^%s%I(B @var{s} $B$r<B9T$7$F$b$i$&(B.
@end table

@table @var
@item return
$B$J$7(B
@item p
$B?t(B
@item s
$BJ8;zNs(B
@end table

@itemize @bullet
@item
 $B%5!<%P$O(B GNUPLOT $B$N%3%^%s%I(B @var{s} $B$r<B9T$9$k(B.  
 $B%(%i!<$,$*$-$?>l9g(B GNUPLOT $BK\BN$O=*N;$7$F$7$^$&$,(B,
 @code{ox_sm1_gnuplot} $B$O<+F0E*$K(B GNUPLOT $BK\BN$r%j%9%?!<%H$9$k(B.
@item
   GNUPLOT $B$OD9$$B?9`<0$r$?$@$7$/$&$1$D$1$J$$(B.
@item
   GNUPLOT $B$O(B @code{^} $B$r$&$1$D$1$J$$(B. $B$+$o$j$K(B, @code{**} $B$r;H$&(B.
@end itemize
*/
/*&C
@example
[232] P = gnuplot.start();
0
*Plot 3 dimensional graph.
[233] gnuplot.gnuplot("splot x**2-y**2;"|proc=P);
0
*Plot 2 dimensional graph.
[234] gnuplot.gnuplot("plot [-pi:pi] [-2:2] cos(x);");
0
*Output a graph as a postscript figure.
[235] gnuplot.output(|file="hoge.eps");
0
[236] gnuplot.gnuplot("plot sin(x)*cos(x);");
0
[237] gnuplot.gnuplot(|file="x11");
0

*Plot 3 dimensional graph hiding unvisible lines.
[236] gnuplot.gnuplot("set hidden3d");
0
[237] gnuplot.gnuplot("splot (x**2+y**2)*sin(x**2+y**2)");
0
[238] gnuplot.gnuplot("set isosamples 50");
0
[239] gnuplot.gnuplot("splot (x**2+y**2)*sin(x**2+y**2)");

@end example
*/
/*&en
@table @t
@item Reference
    @code{ox_launch}, @code{gnuplot.start}, @code{rtostr}, 
    @code{gnuplot.plot_dots}
@item Reference Book
    Yabuki Michiro, Otake Tuyoshi; Tukai konasu GNUPLOT, Techno Press,
    in Japansese,  ISBN4-924998-11-7
@end table
*/
/*&ja
@table @t
@item $B;2>H(B
    @code{ox_launch}, @code{gnuplot.start}, @code{rtostr}, 
    @code{gnuplot.plot_dots}
@item $B;29M=q(B
    $BLp?aF;O:(B, $BBgC]$D$h$7(B; $B;H$$$3$J$9(B GNUPLOT, $B%F%/%N%W%l%9(B,
    ISBN4-924998-11-7
@end table
*/



/*&en
@node gnuplot.plot_dots,,, GNUPLOT Functions
@subsection @code{gnuplot.plot_dots}
@findex gnuplot.plot_dots
@table @t
@item gnuplot.plot_dots(@var{d},@var{s}|proc=@var{p})
::  Plot the dots @var{d} with the style @var{s}.
@end table

@table @var
@item return
Void
@item p
Number
@item d
List
@item s
String or 0
@end table

@itemize @bullet
@item
 Plot the dots @var{d} with the style @var{s}.
    @var{s} is a string of the form
      "style color point".
    Here,
       style can be lines, points, linespoints, impulses, dots, steps, 
       errorbars, boxes, boxerrorbars.
       color can be 1 (red), 2 (green), 3 (blue), 4, ... , 8.
       point can be a number from 1 to 8.
    The color and point field can be omitted.
@item
 When @var{d} == @code{[  ]}, the screen will be cleared.
@end itemize
*/
/*&ja
@node gnuplot.plot_dots,,, GNUPLOT Functions
@subsection @code{gnuplot.plot_dots}
@findex gnuplot.plot_dots
@table @t
@item gnuplot.plot_dots(@var{d},@var{s}|proc=@var{p})
::  $BE@$N=89g(B @var{d} $B$r%9%?%$%k(B @var{s} $B$G%W%m%C%H$9$k(B.
@end table

@table @var
@item return
$B$J$7(B
@item p
$B?t(B
@item d
$B%j%9%H(B
@item s
$BJ8;zNs(B $B$^$?$O(B 0
@end table

@itemize @bullet
@item
 $BE@=89g(B @var{d} $B$r%9%?%$%k(B @var{s} $B$G%W%m%C%H$9$k(B.
    @var{s} $B$O<!$N$h$&$JJ8;zNs(B:
      "style color point".
    $B$3$3$G(B
       style $B$K$O(B lines, points, linespoints, impulses, dots, steps, 
       errorbars, boxes, boxerrorbars
       $B$rA*$Y$k(B.
       color $B$K$O(B 1 (red), 2 (green), 3 (blue), 4, ... , 8
       $B$rA*$Y$k(B.
       point $B$O(B 1 $B$+$i(B 8 $B$N?t$rF~$l$k(B.
    color, point $B$O>JN,$7$F$h$$(B.
@item
  @var{d} == @code{[  ]} $B$N$H$-$O%9%/%j!<%s$,$^$:>C5n$5$l$k(B.
@end itemize
*/
/*&C
@example
[239] P = gnuplot.start();
0
[240] gnuplot.plot_dots([ ],0);            
0
[241] for (I=0; I<10; I++) gnuplot.plot_dots([[I,I^2]]," lines ");
[242] A = [ ];
[]
[243] for (I=0; I<10; I++) A = append(A,[ [I,I^2]]);
[244] A;
[[0,0],[1,1],[2,4],[3,9],[4,16],[5,25],[6,36],[7,49],[8,64],[9,81]]
[245] gnuplot.plot_dots(A," lines ");
0
@end example
*/
/*&ja
@table @t
@item $B;2>H(B
    @code{gnuplot.start}, @code{plot "fileName" with options}(GNUPLOT command),
    @code{gnuplot.clean}, @code{gnuplot}
@end table
*/
/*&en
@table @t
@item Reference
    @code{gnuplot.start}, @code{plot "fileName" with options}(GNUPLOT command),
    @code{gnuplot.clean}, @code{gnuplot}
@end table
*/



/** heat equation **/

/*&en
@node gnuplot.heat,,, GNUPLOT Functions
@subsection @code{gnuplot.heat}
@findex gnuplot.heat
@table @t
@item gnuplot.heat(@var{dt},@var{step})
::  It solves the heat equation numerical and plots solutions
@end table

@table @var
@item return
Void
@item dt
floating point number
@item step
Integer
@end table

@itemize @bullet
@item It solves the heat equation
 du/dt = d^2 u/dx^2,  u(t,0) = u(t,1) = 0
with the initial condition
 u(0,x) = x (0 <= x <= 0.5), u(0,x) = 1-x ( 0.5 <= x <= 1.0).
@item Heat_N is the number of the meshes in the space.
@item This function will be called @code{pde_heat_demo} in a future. 
@end itemize

@noindent
Algorithm: NOT Written. (Difference scheme. Courant-Levi-Friedrichs conditions.)
*/
/*&ja
@node gnuplot.heat,,, GNUPLOT Functions
@subsection @code{gnuplot.heat}
@findex gnuplot.heat
@table @t
@item gnuplot.heat(@var{dt},@var{step})
::  $BG.EAF3J}Dx<0$r?tCME*$K2r$/(B.
@end table

@table @var
@item return
$B$J$7(B
@item dt
$BIbF0>.?tE@?t(B
@item step
$B@0?t(B
@end table

@itemize @bullet
@item $BG.EAF3J}Dx<0(B
 du/dt = d^2 u/dx^2,  u(t,0) = u(t,1) = 0
$B$r=i4|>r7o(B
 u(0,x) = x (0 <= x <= 0.5), u(0,x) = 1-x ( 0.5 <= x <= 1.0)
$B$G2r$/(B.
@item Heat_N $B$O6u4VJ}8~$G$N%a%C%7%e$N?t(B.
@item $B$3$N4X?t$O>-Mh(B @code{pde_heat_demo} $B$H8F$P$l$kM=Dj(B.
@end itemize
*/
/*&C
@example
[232] Heat_N = 20$ 
[233] gnuplot.heat(0.001,30)$
@end example

*/



/*&en
@node gnuplot.output,,, GNUPLOT Functions
@subsection @code{gnuplot.output}
@findex gnuplot.output
@table @t
@item gnuplot.output(|@var{file=s})
::  ask @code{GNUPLOT} to output graphic to the file @var{s} in the Postscript format.
@end table

@table @var
@item return
Void
@item s
String
@end table

@itemize @bullet
@item ask @code{GNUPLOT} to output graphic to the file @var{s} in the Postscript format.
@item When @code{s} is "x11" or this function is called without the argument, 
the output will be written to X11 display.
@end itemize
*/
/*&ja
@node gnuplot.output,,, GNUPLOT Functions
@subsection @code{gnuplot.output}
@findex gnuplot.output
@table @t
@item gnuplot.output(|@var{file=s})
::  @code{GNUPLOT} $B$K%U%!%$%k(B @var{s} $B$X%]%9%H%9%/%j%W%H$G=PNO$9$k$h$&$KMj$`(B.
@end table

@table @var
@item return
Void
@item s
String
@end table

@itemize @bullet
@item  @code{GNUPLOT} $B$K%U%!%$%k(B @var{s} $B$X%]%9%H%9%/%j%W%H$G=PNO$9$k$h$&$KMj$`(B.
@item @code{s} $B$,(B "x11" $B$^$?$O(B, $B$3$N4X?t$r0z?tL5$7$G$h$V$H(B,
$B0J8e(B, X11 $B$N(B display $B$K(B graphics $B$,=PNO$5$l$k(B.
@end itemize
*/

/*&C
@example
[273] gnuplot.output(|file="hoge.eps");
Graphic output of GNUPLOT will be written to hoge.eps as a Poscript file.
0
[274] gnuplot.gnuplot("plot tan(x)+sin(x);");
0
[275] gnuplot.output();
Usage of gnuplot.output: gnuplot.output(|file="string")
                         gnuplot.output(|file="x11")
Output device is set to X11
@end example
*/

/*&en
@table @t
@item Reference
    @code{gnuplot}
@end table
*/
/*&ja
@table @t
@item $B;2>H(B 
    @code{gnuplot}
@end table
*/


/*&en
@node gnuplot.plot_function,,, GNUPLOT Functions
@subsection @code{gnuplot.plot_function}
@findex gnuplot.plot_function
@table @t
@item gnuplot.gnuplot(@var{f}|proc=@var{p})
::  ask the @code{gnuplot} server to draw a graph of @var{f}
@end table

@table @var
@item return
Void
@item p
Number
@item f
Polynomial or a list of polynomials
@end table

@itemize @bullet
@item ask the @code{gnuplot} server to draw a graph of @var{f}
@end itemize
*/

/*&ja
@node gnuplot.plot_function,,, GNUPLOT Functions
@subsection @code{gnuplot.plot_function}
@findex gnuplot.plot_function
@table @t
@item gnuplot.plot_function(@var{f}|proc=@var{p})
::  @code{gnuplot} $B%5!<%P$K(B @var{f} $B$N%0%i%U$r=q$/$h$&$KMj$`(B.
@end table

@table @var
@item $BLa$jCM(B
$B$J$7(B
@item p
$B?t(B
@item f
$BB?9`<0$^$?$OB?9`<0$N%j%9%H(B
@end table

@itemize @bullet
@item @code{gnuplot} $B%5!<%P$K(B @var{f} $B$N%0%i%U$r=q$/$h$&$KMj$`(B.
@end itemize
*/
/*&C

@example
[290] gnuplot.plot_function((x+sin(x))^2);
0
[291] gnuplot.plot_function([x,x^2,x^3]);
0
@end example

*/

/*&en
@table @t
@item Reference
    @code{gnuplot.to_gnuplot_format}
@end table
*/
/*&ja
@table @t
@item $B;2>H(B
    @code{gnuplot.to_gnuplot_format}
@end table
*/

/*&en

@node gnuplot.stop,,, GNUPLOT Functions
@subsection @code{gnuplot.stop}
@findex gnuplot.stop
@table @t
@item gnuplot.stop()
::  Stop the gnuplot and remove the temporary fifo file.
@end table

@table @var
@item return
Void
@item s
String
@end table

@itemize @bullet
@item Stop the @code{GNUPLOT} and remove the temporary fifo file generated 
by the mkfifo system call under the temporary directory.
@end itemize
*/
/*&ja

@node gnuplot.stop,,, GNUPLOT Functions
@subsection @code{gnuplot.stop}
@findex gnuplot.stop
@table @t
@item gnuplot.stop()
::  @code{GNUPLOT} $B$rDd;_$7(B, $BDL?.MQ$N(B fifo $B%U%!%$%k$r>C$9(B.
@end table

@table @var
@item return
Void
@item s
String
@end table

@itemize @bullet
@item  @code{GNUPLOT} $B$rDd;_$7(B, $B0l;~%G%#%l%/%H%j$N2<$K:n@.$5$l$?DL?.MQ$N(B fifo $B%U%!%$%k$r>C$9(B.
@item $BDL?.MQ$N(B fifo $B%U%!%$%kL>$O(B gnuplot $B$G;O$^$k(B.
@end itemize
*/

/*&C
@example
[273] gnuplot.stop()
@end example
*/

/*&en
@table @t
@item Reference
    @code{gnuplot.start}
@end table
*/
/*&ja
@table @t
@item $B;2>H(B 
    @code{gnuplot.start}
@end table
*/

/*&en
@node gnuplot.setenv,,, GNUPLOT Functions
@subsection @code{gnuplot.setenv}
@findex gnuplot.setenv
@table @t
@item gnuplot.setenv(@var{key},@var{value})
::  
@end table

@table @var
@item return
Void
@item key
String
@item value
Object
@end table

@itemize @bullet
@item The @var{key} takes the value either in
"gnuplot.callingMethod" or "plot.gnuplotexec".
@end itemize
*/
/*&ja
@node gnuplot.setenv,,, GNUPLOT Functions
@subsection @code{gnuplot.setenv}
@findex gnuplot.setenv
@table @t
@item gnuplot.setenv(@var{key},@var{value})
::  
@end table

@table @var
@item return
Void
@item key
String
@item value
Object
@end table

@itemize @bullet
@item  @code{key} $B$O(B "gnuplot.callingMethod" $B$^$?$O(B "plot.gnuplotexec".
@end itemize
*/

/*&C
@example
   Use the old method to communicate with gnuplot (version 3).
   This method does not use mkfifo, but we need a patched version of gnuplot.
[273] gnuplot.setenv("gnuplot.callingMethod",0);
[274] gnuplot.setenv("plot.gnuplotexec",getenv("OpenXM_HOME")+"/bin/gnuplot4ox");

   Calling your own gnuplot binary. 
[274] gnuplot.setenv("plot.gnuplotexec","/cygdrive/c/program files/gnuplot/pgnuplot.exe");
@end example
*/

/*&en
@table @t
@item Reference
    @code{gnuplot.start}
@end table
*/
/*&ja
@table @t
@item $B;2>H(B 
    @code{gnuplot.start}
@end table
*/

end$