Rename *ll* and *ul* to ll and ul in defint
[maxima.git] / archive / share / unknown / plot2.prm
blob04745c11c49688146964b7cb45932f5f395f0039
1 This is a primer for PLOT2 (SHARE;PLOT2 PRIMER).  Please look at
2 SHARE;PLOT2 USAGE for full documentation of PLOT2.  (Last revision of
3 this file:  August 1981.)
5 This file contains the "Easy Examples" excerpted from PLOT2 USAGE.
6     You will quite likely be able to figure out what's going on just
7     from these examples.  Only read the relevant section later, if
8     something is unclear.  To see the general capabilities of PLOT2 do
9     DEMO(PLOT2,DEMO,DSK,SHARE); (type spaces after the plots) and
10     most of these examples will be tried.
12 (Sec 1.1)
13   PLOT2(SIN(X),X,-%PI,%PI);     plots sin(X) against X as X takes on
14                                 PLOTNUM values between -%PI to %PI
15   PLOT2(X!,X,0,6,INTEGER);      plots X! as X takes integral values
16                                 between 0 and 6
17   F(X):=SQRT(X+%PI);
18   PLOT2(F(X),X,[-2,3,100.12]);  plots F(X) as X takes the values in
19                                 the values in the list
20   PLOT2([X+1,X^2+1],X,-1,1);    plots 2 curves on top of each other
21 (Sec 1.2)
22   GRAPH2([1,2,3],[5,10,6]);     draws a line connecting [1,5], [2,10],
23                                 [3,6]
24 (Sec 1.3)
25   PARAMPLOT2(COS(T),SIN(T),T,0,2*%PI);  Plots cos(T) for the x-axis and
26         sin(T) for the y-axis as T takes on PLOTNUM (Sec 1.5) values
27         between 0 and 2*%PI.  (If EQUALSCALE is TRUE (Sec 8.3) this
28         draws a circle.)
29 (Sec 1.4)
30   LOAD('[WORLD,FASL,DSK,SHARE]);
31   WORLDPLOT(-15, 10, 48, 60);   draws a map of the United Kingdom.
32 (Sec 3.1)
33   PLOT3D(EXP(-X^2-Y^2)*X,X,-2,2,Y,-1.5,2.5);  Plots exp(-X^2-Y^2)*X as
34         X takes on PLOTNUM values between -2 and 2 and y takes on
35         PLOTNUM1 values between -1.5 and 2.5
36   TRANSLATE:TRUE;       causes automatic translation
37   G(X,Y):=(MODEDECLARE([X,Y],FLOAT),EXP(-X*X-Y*Y)); define a function G
38   PLOT3D(G,-2,2,-2,2);  plot it
39 (Sec 3.3)
40   PLOT3D(SIN(X)+A,X,-%PI,%PI,A,[-2,3,4,6],NOT3D);       plots sin(X)+A
41         for X from -%PI to %PI (PLOTNUM points) and A taking the
42         values in the list.  This is equivalent to:
43         PLOT2([SIN(X)-2,SIN(X)+3,SIN(X)+4,SIN(X)+6],X,-%PI,%PI);
44         but requires less typing.
45 (Sec 4.1)
46   CONTOURS:10;          Do 10 contours
47   LABELCONTOURS:FALSE;  Don't label the contours
48   CONTOURPLOT2(Y^2/2+COS(X)+X/2,X,-6,6,Y,-3,3);         Do a contour
49         plot of Y^2/2+cos(X) as X takes PLOTNUM values between -6
50         and 6 and as Y takes PLOTNUM1 values between -3 and 3.
51         (This gives you the phase space orbits of a particle in a
52         periodic potential superimposed on a constant field).
53   PLOT3D(Y^2/2+COS(X)+X/2,X,-6,6,Y,-3,3,CONTOUR);       The same
54   CONTOURS:[0];         Plot only the zero contour.
55   CONTOURPLOT2([REALPART((X+%I*Y)^3-1),IMAGPART((X+%I*Y)^3-1)],
56         X,-1.5,1.5,Y,-1.5,1.5,[0,1]);   Finds the zeroes of Z^3=-1 in
57         the complex plane.
58   CONTOURS:PLOTNUM:PLOTNUM1:10; Work with a 10x10 grid
59   CONTOURPLOT2(RANDOM(100),X,0,1,Y,0,1);        Plot something random
60 (Sec 5.1)
61   PLOT2(1,X,0,2*%PI);   Plots a straight line
62   REPLOT(TRUE,POLAR);   Plots it in polar coordinates (Sec 13.1). This
63         will appear as an ellipse unless EQUALSCALE:TRUE (Sec 8.3)
64   EQUALSCALE:TRUE;
65   REPLOT();             Replots the ellipse with EQUALSCALE equal to
66         TRUE;  this will then appear as a circle.
67 (Sec 5.2)
68   PLOTMODE(DISPLAY,XGP);        Set things up for plotting on the XGP
69         and a datapoint.
70 (Sec 6.1)
71   PLOT2(EXP(X),X,0,3,X,EXP(X),"THIS IS A PLOT OF EXP(X) VS. X");
72         plots a curve of exp(X) with an x-label of "X", a y-label of
73         "EXP(X)" and a tile of "THIS IS A PLOT OF EXP(X) VS. X" (the
74         labels don't appear with the "'s)
75   A:3;
76   PLOT2(SIN(X)+A,X,-%PI,%PI,FALSE,FALSE,LABEL(A));
77         plots sin(X)+A and sticks an the title "A=3".
78   PLOT2(SIN(X),X,-%PI,%PI,FALSE,SIN(X));        labels the y-axis with
79         "SIN(X)".
80 (Sec 9.1)
81   PLOT2([SIN(X),COS(X)],X,-%PI,%PI,[0,1]);      Plots sin(X) with line
82         type 0 (a solid line) and cos(X) with line type 1 (a dashed
83         line)
84   PARAMPLOT2(RANDOM(),RANDOM(),X,0,1,[19]);     Plots PLOTNUM
85         "random" points with symbol 1 (no connecting lines drawn)
86   TT:[0,1,2,3,4,5,6,7,8];
87   PLOTNUM1:9;
88   PLOT3D(SIN(X)+A,X,-%PI,%PI,A,0,2,TT,NOT3D);   Gives the full
89         repertory of line types
90   TT:9+10*(TT+1);       TT is now [19,29,39 ... ]
91   REPLOT(TRUE,TT);      Gives the full repertory of symbol types.
92 (Sec 13.1)
93   PLOT2(1,T,0,2*%PI,POLAR);     Plots a circle
94   REPLOT(TRUE,LIN);             Replots the previous plot on a linear
95         scale (i.e., gives a horizontal line)
96   PLOT2(EXP(X),X,0,10,LINLOG);  Plots exp(X) on a Lin-Log scale
97         (appears as a straight line)
98   GRAPH2([1,2,5,10,50,100],[1,1.5,2.5,3,7,10],LOG);     Plots some
99         random points on Log-Log scale.  Slope shows that y=sqrt(x).
100 \0\0\0