home *** CD-ROM | disk | FTP | other *** search
- 8.11 Plot Function Package
- ---------------------------------------------------------------------
- # The plot function package plot.sm
- # to plot a function.
- # plot(x^2, x) # plot the function of x^2
- # plot(x^2, x,-6,6) # plot the function of x^2 from x=-6 to x=6
- # end
-
- output=off
- plot(y_,x_,x1_,x2_,dx_) := block(openfile('symbmath.out'),
- table(y,x,x1,x2,dx),
- closefile('symbmath.out'),
- system(plotdata))
- plot(y_,x_,x1_,x2_) := plot(y,x,x1,x2,(x2-x1)*0.5)
- plot(y_,x_) := plot(y,x,-5,5,0.5)
- output=on
- end
- ----------------------------------------------------------------------
-
- If SymbMath is interfaced with the software PlotData, SymbMath
- produces the data table of functions, and PlotData plots from the
- table. So SymbMath seems to plot the function. This interface can be
- used to solve equations graphically.
- In the plot package 'plot.sm' the funcion
- plot(y, x, x1, x2, dx)
- first open a file 'SymbMath.Out' for writing, then write the data table
- of the function y into the file 'SymbMath.out', then close the file,
- and finally automatically call the software PlotData to plot. After it
- exits from PlotData, it automatically return to SymbMath.
- The functions
- plot(y, x)
- plot(y, x from xmin to xmax)
- call the function plot(y,x,x1,x2,dx)
- e.g. plot x^2.
- Input:
- plot(x^2, x)
- end
-
- in the software PlotData, just select the option to read the file
- 'SymbMath.out' and to plot. PlotData read the data in the SymbMath
- format without any modification (and in many data format).
- In PlotData,
- in the main menu:
- 1 <Enter>
- in the read menu:
- 2 <Enter>
- <Enter>
- in the main menu:
- 2 <Enter>
- in the graph menu:
- 1 <Enter>
-
- where <Enter> is the <Enter> key.
- Refer to PlotData for detail.
- Note that if your monitor is Hercules, you must load the
- MSHERC.COM program as a TRS program before you run PlotData.
- Otherwise you will get Error when you plot.
-
- 8.12 List Plot Package
- ----------------------------------------------------------------------
- # the list plot package 'listplot.sm'
- # to plot a list of data.
- # listplot([1,2,3,4,5,4,3,2,1])
- # end
-
- output=off
- listplot(y_) := if(islist(y), block(yy=y, length=length(yy),
- openfile('symbmath.out'),
- table(yy[xx],xx,1,length),
- closefile('symbmath.out'),
- system(plotdata) ))
- output=on
- end
- ---------------------------------------------------------------------
-