Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (01/15/90)
Submitted-by: Anthony M. Richardson <amr@dukee.egr.duke.edu> Posting-number: Volume 90, Issue 003 Archive-name: applications/plplot-2.6/part02 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 2 (of 12)." # Contents: Amiga/plprefs.c docs/plotdoc.tex examples/example03.c # examples/example04.c examples/example06.c examples/example07.c # examples/example08.c examples/example11.c examples/example12.c # examples/example13.c fonts/plxtnd.lkp.uu src/Makefile src/fcnvrt.c # src/genlin.c src/plbin.c src/plccal.c src/plcont.c src/pldtik.c # src/plform.c src/plhist.c src/plhrsh.c src/pllclp.c src/pllsty.c # src/plpsty.c src/plptex.c src/plstrl.c src/plstyl.c src/plsvpa.c # src/plvpor.c src/plwind.c src/plxytx.c src/plztx.c unix/dg300.c # Wrapped by tadguy@xanth on Sun Jan 14 18:11:26 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Amiga/plprefs.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Amiga/plprefs.c'\" else echo shar: Extracting \"'Amiga/plprefs.c'\" \(1059 characters\) sed "s/^X//" >'Amiga/plprefs.c' <<'END_OF_FILE' X#include "plplot.h" X#include "plamiga.h" X#include <stdio.h> X Xstruct PLPrefs PLCurPrefs; X Xstatic struct PLPrefs PLDefPrefs = { X PLCUST | PLBUFF, X PLLACE | PLHIRES, X 20, 20, X 300, 200, X 0, 0, /* Let ScreenChange set width and height for custom screen */ X 0, 0, X 2, X 0xCCC, 0x000, 0x00D, 0x080, 0xF00, 0xEE0, 0xE90, 0xF0F, X 0x0BE, 0x090, 0x999, 0xBBB, 0xF99, 0x909, 0x0DB, 0xDDD X}; X Xvoid GetPLDefs(void) X{ X FILE *PrefsFile; X X /* Read user preferences from s:PlPlot/PlPlot.def if it exists, X otherwise use default preferences */ X X if((PrefsFile = fopen("s:PlPlot.def","r")) != NULL) { X (void)fread((char *)&PLDefPrefs,sizeof(struct PLPrefs),1,PrefsFile); X (void)fclose(PrefsFile); X } X PLCurPrefs = PLDefPrefs; X} X Xvoid SetPLDefs(void) X{ X FILE *PrefsFile; X X if((PrefsFile = fopen("s:PlPlot.def","w")) != NULL) { X (void)fwrite((char *)&PLCurPrefs,sizeof(struct PLPrefs),1,PrefsFile); X (void)fclose(PrefsFile); X } X PLDefPrefs = PLCurPrefs; X} X Xvoid RestorePrefs(void) X{ X PLCurPrefs = PLDefPrefs; X} X END_OF_FILE if test 1059 -ne `wc -c <'Amiga/plprefs.c'`; then echo shar: \"'Amiga/plprefs.c'\" unpacked with wrong size! fi # end of 'Amiga/plprefs.c' fi if test -f 'docs/plotdoc.tex' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'docs/plotdoc.tex'\" else echo shar: Extracting \"'docs/plotdoc.tex'\" \(1216 characters\) sed "s/^X//" >'docs/plotdoc.tex' <<'END_OF_FILE' X\documentstyle[11pt]{report} X\newenvironment{ename}{\list{}{\setlength{\leftmargin}{0pc}}\item[]}{\endlist} X\newenvironment{edescr}{\list{}{\setlength{\leftmargin}{4pc} X\setlength{\topsep}{0pc}}\item[]}{\endlist} X\newenvironment{eargn}{\list{}{\setlength{\leftmargin}{2pc}}\item[]}{\endlist} X\newenvironment{eargd}{\list{}{\setlength{\leftmargin}{2pc} X\setlength{\topsep}{0pc}\setlength{\parskip}{0pc}}\item[]}{\endlist} X\newcommand{\name}[1]{\begin{ename}{\tt #1}\end{ename}} X\newcommand{\bname}[1]{\pagebreak[2]\begin{ename}{\fbox{\tt #1}}\end{ename}\nopagebreak} X\newcommand{\descr}[1]{\begin{edescr}#1\end{edescr}} X\newcommand{\argu}[2]{\pagebreak[2]\begin{eargn}#1:\nopagebreak\begin{eargd}#2\end{eargd}\end{eargn}} X\newcommand{\rou}[1]{{\tt #1} (page~\pageref{#1})} X\setlength{\textheight}{23 cm} X\setlength{\textwidth}{16 cm} X\setlength{\oddsidemargin}{0 cm} X\setlength{\evensidemargin}{\oddsidemargin} X\setlength{\topmargin}{-1.5 cm} X\title{The PLPLOT Plotting Library \\ Programmer's Reference Manual \\ X Version 2.6} X\author{Tony Richardson} X\begin{document} X\pagenumbering{roman} X\maketitle X\tableofcontents X\include{chapter1} X\include{chapter2} X\include{chapter3} X\include{chapter4} X\end{document} END_OF_FILE if test 1216 -ne `wc -c <'docs/plotdoc.tex'`; then echo shar: \"'docs/plotdoc.tex'\" unpacked with wrong size! fi # end of 'docs/plotdoc.tex' fi if test -f 'examples/example03.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example03.c'\" else echo shar: Extracting \"'examples/example03.c'\" \(1463 characters\) sed "s/^X//" >'examples/example03.c' <<'END_OF_FILE' X/* Illustration of 1-1 scaling for polar plot */ X#include "plplot.h" X#include <stdio.h> X#include <math.h> X Xmain() X{ X int i,j; X float dtr, theta, dx, dy, r; X char text[3]; X static float x0[361], y0[361]; X static float x[361], y[361]; X X dtr = 3.141592654/180.0; X for (i=0; i<=360; i++) { X x0[i] = cos(dtr * i); X y0[i] = sin(dtr * i); X } X X plstar(1,1); X X /* Set up viewport and window, but do not draw box */ X X plenv(-1.3,1.3,-1.3,1.3,1,-2); X for (i=1; i<=10; i++) { X for (j=0; j<=360; j++) { X x[j] = 0.1*i*x0[j]; X y[j] = 0.1*i*y0[j]; X } X X /* Draw circles for polar grid */ X X plline(361,x,y); X } X X plcol(2); X for (i=0; i<=11; i++) { X theta = 30.0*i; X dx = cos(dtr*theta); X dy = sin(dtr*theta); X X /* Draw radial spokes for polar grid */ X X pljoin(0.0,0.0,dx,dy); X sprintf(text,"%d",round(theta)); X X /* Write labels for angle */ X X if (dx >= 0) X plptex(dx,dy,dx,dy,-0.15,text); X else X plptex(dx,dy,-dx,-dy,1.15,text); X } X X /* Draw the graph */ X X for (i=0; i<=360; i++) { X r = sin(dtr*(5*i)); X x[i] = x0[i] * r; X y[i] = y0[i] * r; X } X plcol(3); X plline(361,x,y); X X plcol(4); X plmtex("t",2.0,0.5,0.5,"#frPLPLOT Example 3 - r(#gh)=sin 5#gh"); X X /* Close the plot at end */ X X plend(); X} X END_OF_FILE if test 1463 -ne `wc -c <'examples/example03.c'`; then echo shar: \"'examples/example03.c'\" unpacked with wrong size! fi # end of 'examples/example03.c' fi if test -f 'examples/example04.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example04.c'\" else echo shar: Extracting \"'examples/example04.c'\" \(997 characters\) sed "s/^X//" >'examples/example04.c' <<'END_OF_FILE' X/* Illustration of logarithmic axes, and redefinition of window */ X X#include "plplot.h" X#include <math.h> X Xmain() X{ X int i; X static PLFLT freql[101],ampl[101],phase[101]; X PLFLT f0, freq; X X plstar(1,1); X pladv(0); X plfont(2); X X f0 = 1000.0; X for (i=0; i<=100; i++) { X freql[i]=1.0+i/20.0; X freq= pow(10.0,freql[i]); X ampl[i]=20.0*log10(1.0/sqrt(1.0+pow((freq/f0),2.))); X phase[i]=-(180.0/3.141592654)*atan(freq/f0); X } X X plvpor(0.15,0.85,0.1,0.9); X plwind(1.0,6.0,-80.0,0.0); X plcol(1); X plbox("bclnst",0.0,0,"bnstv",0.0,0); X plcol(2); X plline(101,freql,ampl); X plcol(1); X plptex(5.0,-30.0,1.0,-20.0,0.5,"-20 dB/decade"); X plwind(1.0,6.0,-100.0,0.0); X plbox(" ",0.0,0,"cmstv",30.0,3); X plcol(3); X plline(101,freql,phase); X X plcol(1); X plmtex("b",3.2,0.5,0.5,"Frequency"); X plmtex("t",2.0,0.5,0.5,"Single Pole Low-Pass Filter"); X plcol(2); X plmtex("l",5.0,0.5,0.5,"Amplitude (dB)"); X plcol(3); X plmtex("r",5.0,0.5,0.5,"Phase shift (degrees)"); X X plend(); X} END_OF_FILE if test 997 -ne `wc -c <'examples/example04.c'`; then echo shar: \"'examples/example04.c'\" unpacked with wrong size! fi # end of 'examples/example04.c' fi if test -f 'examples/example06.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example06.c'\" else echo shar: Extracting \"'examples/example06.c'\" \(1125 characters\) sed "s/^X//" >'examples/example06.c' <<'END_OF_FILE' X/* Displays the plotter symbols for PLPOIN */ X X#include "plplot.h" X#include <stdio.h> X Xmain() X{ X char text[3]; X PLINT i, j, k; X PLFLT x, y; X X /* Full sized page for display */ X X plstar(1,1); X pladv(0); X X /* Set up viewport and window */ X X plvpor((PLFLT)0.1,(PLFLT)1.0,(PLFLT)0.1,(PLFLT)0.9); X plwind((PLFLT)0.0,(PLFLT)1.0,(PLFLT)0.0,(PLFLT)1.3); X X /* Draw the grid using plbox */ X X plbox("bcgt",(PLFLT)0.1,0,"bcgt",(PLFLT)0.1,0); X X /* Write the digits below the frame */ X X for (i=0; i<=9; i++) { X sprintf(text,"%d",i); X plmtex("b",(PLFLT)1.5,(PLFLT)(0.1*i+0.05),(PLFLT)0.5,text); X } X X k=0; X for (i=0; i<=12; i++) { X X /* Write the digits to the left of the frame */ X X sprintf(text,"%d",10*i); X plmtex("lv",1.0,1.0-(2*i+1)/26.0,1.0,text); X for (j=0; j<=9; j++) { X x=0.1*j+0.05; X y=1.25-0.1*i; X X /* Display the symbols (plpoin expects that x and y are arrays so */ X /* pass pointers) */ X X if (k < 128) plpoin(1,&x,&y,k); X k=k+1; X } X } X X plmtex("t",1.5,0.5,0.5,"PLPLOT Example 6 - PLPOIN symbols"); X plend(); X} X X X X END_OF_FILE if test 1125 -ne `wc -c <'examples/example06.c'`; then echo shar: \"'examples/example06.c'\" unpacked with wrong size! fi # end of 'examples/example06.c' fi if test -f 'examples/example07.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example07.c'\" else echo shar: Extracting \"'examples/example07.c'\" \(1152 characters\) sed "s/^X//" >'examples/example07.c' <<'END_OF_FILE' X/* Displays the plotter symbols for PLSYM */ X X#include "plplot.h" X#include <stdio.h> X Xstatic int base[17] = { 0, 200, 500, 600, 700, 800, 900, X 2000,2100,2200,2300,2400,2500,2600,2700,2800,2900 }; X Xmain() X{ X char text[4]; X int i, j, k, l; X float x, y; X X /* Full sized page for display */ X X plstar(1,1); X plfontld(1); X for (l=0; l<17; l++) { X pladv(0); X X /* Set up viewport and window */ X X plvpor(0.1,1.0,0.1,0.9); X plwind(0.0,1.0,0.0,1.0); X X /* Draw the grid using plbox */ X X plbox("bcgt",0.1,0,"bcgt",0.1,0); X X /* Write the digits below the frame */ X X for (i=0; i<=9; i++) { X sprintf(text,"%d",i); X plmtex("b",1.5,0.1*i+0.05,0.5,text); X } X X k=0; X for (i=0; i<=9; i++) { X X /* Write the digits to the left of the frame */ X X sprintf(text,"%d",base[l]+10*i); X plmtex("lv",1.0,0.95-0.1*i,1.0,text); X for (j=0; j<=9; j++) { X x=0.1*j+0.05; X y=0.95-0.1*i; X X /* Display the symbols */ X X plsym(1,&x,&y,base[l]+k); X k=k+1; X } X } X X plmtex("t",1.5,0.5,0.5,"PLPLOT Example 7 - PLSYM symbols"); X } X plend(); X} END_OF_FILE if test 1152 -ne `wc -c <'examples/example07.c'`; then echo shar: \"'examples/example07.c'\" unpacked with wrong size! fi # end of 'examples/example07.c' fi if test -f 'examples/example08.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example08.c'\" else echo shar: Extracting \"'examples/example08.c'\" \(1338 characters\) sed "s/^X//" >'examples/example08.c' <<'END_OF_FILE' X/* Demonstration of 3-d plotting */ X X#include "plplot.h" X#include <math.h> X X#define NPTS 41 X Xstatic int opt[] = {1, 2, 3, 3}; X Xstatic float alt[] = {60.0,20.0,60.0,60.0}; X Xstatic float az[] = {30.0,60.0,120.0,160.0}; X Xstatic char *title[4] = { X "#frPLPLOT Example 8 - Alt=60, Az=30, Opt=1", X "#frPLPLOT Example 8 - Alt=20, Az=60, Opt=2", X "#frPLPLOT Example 8 - Alt=60, Az=120, Opt=3", X "#frPLPLOT Example 8 - Alt=60, Az=160, Opt=3" X}; X Xstatic float x[NPTS], y[NPTS], z[NPTS][NPTS]; X Xmain() X{ X int i, j, k; X X float xx, yy, r; X X for (i=0; i<NPTS; i++) { X x[i] = (i-(NPTS/2))/(double)(NPTS/2); X y[i] = (i-(NPTS/2))/(double)(NPTS/2); X } X X for (i=0; i<NPTS; i++) { X xx = x[i]; X for (j=0; j<NPTS; j++) { X yy = y[j]; X r = sqrt(xx*xx + yy*yy); X z[i][j] = exp(-r*r) * cos(2.0*3.141592654*r); X } X } X X plstar(1,1); X X for (k=0; k<4; k++) { X pladv(0); X plvpor(0.0,1.0,0.0,0.9); X plwind(-1.0,1.0,-0.9,1.1); X plcol(1); X plw3d(1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,alt[k],az[k]); X plbox3("bnstu","x axis",0.0,0,"bnstu","y axis",0.0,0, X "bcdmnstuv","z axis",0.0,0); X plcol(2); X plot3d(x,y,&z[0][0],NPTS,NPTS,NPTS,opt[k],1); X plcol(3); X plmtex("t",1.0,0.5,0.5,title[k]); X } X X pltext(); X plend(); X} END_OF_FILE if test 1338 -ne `wc -c <'examples/example08.c'`; then echo shar: \"'examples/example08.c'\" unpacked with wrong size! fi # end of 'examples/example08.c' fi if test -f 'examples/example11.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example11.c'\" else echo shar: Extracting \"'examples/example11.c'\" \(1375 characters\) sed "s/^X//" >'examples/example11.c' <<'END_OF_FILE' X/* Demonstration of mesh plotting (just like example08 but mesh) */ X X#include "plplot.h" X#include <math.h> X X#define NPTS 41 X Xstatic PLINT opt[] = {1, 2, 3, 3}; X Xstatic PLFLT alt[] = {60.0,20.0,60.0,60.0}; X Xstatic PLFLT az[] = {30.0,60.0,120.0,160.0}; X Xstatic char *title[4] = { X "#frPLPLOT Example 11 - Alt=60, Az=30, Opt=1", X "#frPLPLOT Example 11 - Alt=20, Az=60, Opt=2", X "#frPLPLOT Example 11 - Alt=60, Az=120, Opt=3", X "#frPLPLOT Example 11 - Alt=60, Az=160, Opt=3" X}; X Xstatic float x[NPTS], y[NPTS], z[NPTS][NPTS]; X Xmain() X{ X int i, j, k; X X float xx, yy, r; X X for (i=0; i<NPTS; i++) { X x[i] = (i-(NPTS/2))/(double)(NPTS/2); X y[i] = (i-(NPTS/2))/(double)(NPTS/2); X } X X for (i=0; i<NPTS; i++) { X xx = x[i]; X for (j=0; j<NPTS; j++) { X yy = y[j]; X r = sqrt(xx*xx + yy*yy); X z[i][j] = exp(-r*r) * cos(2.0*3.141592654*r); X } X } X X plstar(1,1); X X for (k=0; k<4; k++) { X pladv(0); X plcol(1); X plvpor(0.0,1.0,0.0,0.9); X plwind(-1.0,1.0,-0.9,1.1); X X plw3d(1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,alt[k],az[k]); X plbox3("bnstu","x axis",0.0,0,"bnstu","y axis",0.0,0, X "bcdmnstuv","z axis",0.0,0); X plcol(2); X plmesh(x,y,&z[0][0],NPTS,NPTS,NPTS,opt[k]); X plcol(3); X plmtex("t",1.0,0.5,0.5,title[k]); X } X X pltext(); X plend(); X} END_OF_FILE if test 1375 -ne `wc -c <'examples/example11.c'`; then echo shar: \"'examples/example11.c'\" unpacked with wrong size! fi # end of 'examples/example11.c' fi if test -f 'examples/example12.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example12.c'\" else echo shar: Extracting \"'examples/example12.c'\" \(1146 characters\) sed "s/^X//" >'examples/example12.c' <<'END_OF_FILE' X/* Demonstration program for PLPLOT: Bar chart example. */ X X#include "plplot.h" X#include <stdio.h> X Xvoid plfbox(x0,y0) XPLFLT x0,y0; X{ X PLFLT x[4], y[4]; X X x[0] = x0; X y[0] = 0.; X x[1] = x0; X y[1] = y0; X x[2] = x0+1.; X y[2] = y0; X x[3] = x0+1.; X y[3] = 0.; X plfill(4,x,y); X plcol(1); X pllsty(1); X plline(4,x,y); X} X Xmain() X{ X int i; X char string[20]; X PLFLT y0[10]; X X /* Ask user to specify the output device */ X plstar(1,1); X X pladv(0); X plvsta(); X plwind(1980.,1990.,0.,35.); X plbox("bc",1.,0,"bcnv",10.,0); X plcol(2); X pllab("Year","Widget Sales (millions)","#frPLPLOT Example 12"); X X y0[0] = 5; X y0[1] = 15; X y0[2] = 12; X y0[3] = 24; X y0[4] = 28; X y0[5] = 30; X y0[6] = 20; X y0[7] = 8; X y0[8] = 12; X y0[9] = 3; X X for(i=0; i<10; i++) { X plcol(i%4+1); X plpsty((i+3)%8+1); X pllsty(i%8+1); X plfbox((PLFLT)(1980+i),y0[i]); X sprintf(string,"%.0f",y0[i]); X plptex(1980+i+.5,y0[i]+1.,1.,0.,.5,string); X sprintf(string,"%d",1980+i); X plmtex("b",1.,(i+1)*.1-.05,.5,string); X } X X /* Don't forget to call PLEND to finish off! */ X plend(); X} END_OF_FILE if test 1146 -ne `wc -c <'examples/example12.c'`; then echo shar: \"'examples/example12.c'\" unpacked with wrong size! fi # end of 'examples/example12.c' fi if test -f 'examples/example13.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'examples/example13.c'\" else echo shar: Extracting \"'examples/example13.c'\" \(1326 characters\) sed "s/^X//" >'examples/example13.c' <<'END_OF_FILE' X/* Demonstration program for PLPLOT: */ X X#include "plplot.h" X#include <stdio.h> X#include <math.h> X Xstatic char *text[] = { X "Howard", X "Bobby", X "Georgios", X "Davendra" X}; X Xmain() X{ X int i, j; X PLFLT dthet, theta0, theta1, theta, just, dx, dy; X static PLFLT x[400], y[400], per[4]; X X per[0] = 10.; X per[1] = 40.; X per[2] = 15.; X per[3] = 35.; X X /* Ask user to specify the output device */ X plstar(1,1); X X plenv(0.,10.,0.,10.,1,-2); X plcol(2); X X theta0 = 0.; X dthet = 2*PI/400; X for(i=0; i<=3; i++) { X j = 0; X x[j] = 5.; X y[j++] = 5.; X theta1 = theta0 + 2*PI*per[i]/100.; X if(i==3) theta1 = 2*PI; X for(theta = theta0; theta <=theta1; theta += dthet){ X x[j] = 5 + 3*cos(theta); X y[j++] = 5 + 3*sin(theta); X } X plcol(i+1); X plpsty((i+3)%8+1); X plfill(j,x,y); X plcol(1); X plline(j,x,y); X just = (theta0+theta1)/2.; X dx = .25*cos(just); X dy = .25*sin(just); X if(just < PI/2 || just > 3*PI/2) { X just = 0.; X } X else { X just = 1.; X } X plptex(x[j/2]+dx,y[j/2]+dy,1.,0.,just,text[i]); X theta0 = theta-dthet; X } X plfont(2); X plschr(0.,1.3); X plptex(5.,9.,1.,0.,.5,"Percentage of Sales"); X X /* Don't forget to call PLEND to finish off! */ X plend(); X} X END_OF_FILE if test 1326 -ne `wc -c <'examples/example13.c'`; then echo shar: \"'examples/example13.c'\" unpacked with wrong size! fi # end of 'examples/example13.c' fi if test -f 'fonts/plxtnd.lkp.uu' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'fonts/plxtnd.lkp.uu'\" else echo shar: Extracting \"'fonts/plxtnd.lkp.uu'\" \(2014 characters\) sed "s/^X//" >'fonts/plxtnd.lkp.uu' <<'END_OF_FILE' Xbegin 644 plxtnd.lkp XM!+`#20.#`TT#3P-(`TX#20-*".P(Z0+?`TL#3`-)`V(#9`-3`U(#6`-)`X0#T XMA0.&`X<#B`.)`XH#BPC7"-4(U@C8`KL"R@+-`MT"SPC?`MX"S`+1`M("V`+5Y XM`L<"U`+&`M`"O`*]`KX"OP+``L$"P@+#`L0"Q0+(`LD(P0+6",("RPCA`?4!_ XM]@'W`?@!^0'Z`?L!_`']`?X!_P(``@$"`@(#`@0"!0(&`@<""`()`@H""P(,Z XM`@T"#@BO`MD(L`+.`MD(R0)9`EH"6P)<`ET"7@)?`F`"80)B`F,"9`)E`F8"\ XM9P)H`FD":@)K`FP";0)N`F\"<`)Q`G((L0+3"+((Q@*[`@\"$`(1`A("$P(4T XM`A4"%@(7`A@"&0(:`AL"'`(=`AX"'P(@`B$"(@(C`B0")0(F`G,"=`)U`G8"3 XMK`)X`GD"K0)[`GP"?0)^`G\"@`*!`H("@P*$`H4"A@*N`H@"B0**`TD#@P--A XM`T\#2`-.`TD#2@CL".D"WP-+`TP#20-B`V0#4P-2`U@#20.$`X4#A@.'`X@#$ XMB0.*`XL(UPC5"-8(V`B7"*8(J0CC".((WPC@"*@(K0BN"*L(N`BC"+<(H@BL6 XM")@(F0B:")L(G`B=")X(GPB@"*$(I`BE",$(O@C""*<(X0?1!]('TP?4!]4'` XMU@?7!]@'V0?:!]L'W`?=!]X'WP?@!^$'X@?C!^0'Y0?F!^<'Z`?I!^H(KPB\G XM"+`(J@B\",D(-0@V"#<(.`@Y"#H(.P@\"#T(/@@_"$`(00A""$,(1`A%"$8(J XM1PA("$D(2@A+"$P(30A."+$(M0BR",8(EP?K!^P'[0?N!^\'\`?Q!_('\P?T* XM!_4']@?W!_@'^0?Z!_L'_`?]!_X'_P@`"`$(`@A/"%`(40A2"(@(5`A5"(D(J XM5PA8"%D(6@A;"%P(70A>"%\(8`AA"&((B@AD"&4(9@-)`X,#30-/`T@#3@-)C XM`TH([`CI`M\#2P-,`TD#8@-D`U,#4@-8`TD#A`.%`X8#AP.(`XD#B@.+"-<(5 XMU0C6"-@(EPK,"MH(XPK1"-\*T`K9"M,*U`K5"M<*R0K6"L@*T@J^"K\*P`K!8 XM"L(*PPK$"L4*Q@K'"LH*RPC!"M@(P@K-".$(`P@$"`4(!@@'"`@("0@*"`L($ XM#`@-"`X(#P@0"!$($@@3"!0(%0@6"!<(&`@9"!H(&P@<"*\(O`BP"ML(O`C)! XM"&<(:`AI"&H(:PAL"&T(;@AO"'`(<0AR"',(=`AU"'8(=PAX"'D(>@A["'P(Y XM?0A^"'\(@`BQ"+4(L@C&")<'ZP?L!^T'[@?O!_`'\0?R!_,']`?U!_8']P?X& XM!_D'^@?[!_P'_0?^!_\(``@!"`((3PA0"%$(4@B("%0(50B)"%<(6`A9"%H(V XM6PA<"%T(7@A?"&`(80AB"(H(9`AE"&8#20.#`TT#3P-(`TX#20-*".P(Z0+?T XM`TL#3`-)`V(#9`-3`U(#6`-)`X0#A0.&`X<#B`.)`XH#BPC7"-4(U@C8")<*^ XMS`K:".,*T0C?"M`*V0K3"M0*U0K7"LD*U@K("M(*O@J_"L`*P0K""L,*Q`K%2 XM"L8*QPK*"LL(P0K8",(*S0CA"?<)^`GY"?H)^PG\"?T)_@G_"@`*`0H""@,*; XM!`H%"@8*!PH("@D*"@H+"@P*#0H."@\*$`BO"+P(L`K;"+P(R0I;"EP*70I>! XM"E\*8`IA"F(*8PID"F4*9@IG"F@*:0IJ"FL*;`IM"FX*;PIP"G$*<@IS"G0(U XML0BU"+((Q@B7!^L'[`?M!^X'[P?P!_$'\@?S!_0']0?V!_<'^`?Y!_H'^P?\R XM!_T'_@?_"``(`0@""$\(4`A1"%((B`A4"%4(B0A7"%@(60A:"%L(7`A="%X(" X/7PA@"&$(8@B*"&0(90AFS X`` Xend Xsize 1410 END_OF_FILE if test 2014 -ne `wc -c <'fonts/plxtnd.lkp.uu'`; then echo shar: \"'fonts/plxtnd.lkp.uu'\" unpacked with wrong size! fi # end of 'fonts/plxtnd.lkp.uu' fi if test -f 'src/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/Makefile'\" else echo shar: Extracting \"'src/Makefile'\" \(1963 characters\) sed "s/^X//" >'src/Makefile' <<'END_OF_FILE' X# X# Lattice definitions X# XCFLAGS = $(LFLG1) $(LFLG2) -i/include -O XCC = lc X# XOBJS = define.o \ X fcnvrt.o \ X genlin.o \ X global.o \ X icnvrt.o \ X movphy.o \ X movwor.o \ X pl3cut.o \ X plabv.o \ X pladv.o \ X plbeg.o \ X plbin.o \ X plbox.o \ X plbox3.o \ X plccal.o \ X plclr.o \ X plcntr.o \ X plcol.o \ X plcont.o \ X plcvec.o \ X pldeco.o \ X pldtik.o \ X plend.o \ X plenv.o \ X plerrx.o \ X plerry.o \ X plerx1.o \ X plery1.o \ X plexit.o \ X plfill.o \ X plfont.o \ X plfontld.o \ X plform.o \ X plgra.o \ X plgrid3.o \ X plgspa.o \ X plhist.o \ X plhrsh.o \ X pljoin.o \ X pllab.o \ X pllclp.o \ X plline.o \ X pllsty.o \ X plmesh.o \ X plmtex.o \ X plnxtv.o \ X plot3d.o \ X plpage.o \ X plpat.o \ X plpoi1.o \ X plpoin.o \ X plpsty.o \ X plptex.o \ X plr135.o \ X plr45.o \ X plschr.o \ X plside3.o \ X plsmaj.o \ X plsmin.o \ X plssym.o \ X plstar.o \ X plstik.o \ X plstr.o \ X plstrl.o \ X plstyl.o \ X plsvpa.o \ X plsym.o \ X plsym1.o \ X plt3zz.o \ X pltext.o \ X plvpor.o \ X plvsta.o \ X plw3d.o \ X plwid.o \ X plwind.o \ X plxtik.o \ X plxybx.o \ X plxytx.o \ X plytik.o \ X plzbx.o \ X plztx.o \ X setphy.o \ X setpxl.o \ X setsub.o \ X stindex.o \ X strpos.o \ X stsearch.o \ X xform.o X X.c.o: X $(CC) $(CFLAGS) $*.c X Xlib: $(OBJS) END_OF_FILE if test 1963 -ne `wc -c <'src/Makefile'`; then echo shar: \"'src/Makefile'\" unpacked with wrong size! fi # end of 'src/Makefile' fi if test -f 'src/fcnvrt.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/fcnvrt.c'\" else echo shar: Extracting \"'src/fcnvrt.c'\" \(1522 characters\) sed "s/^X//" >'src/fcnvrt.c' <<'END_OF_FILE' X/* Coordinate transformations for plotting package */ X X#include "plplot.h" X#include "declare.h" X#include <math.h> X X/* dcmm. converts from device coordinates to millimetres from bottom */ X/* left-hand corner */ X XPLFLT dcmmx(x) XPLFLT x; X{ X return((PLFLT)(x * abs(phyxma-phyxmi) / xpmm)); X} X XPLFLT dcmmy(y) XPLFLT y; X{ X return((PLFLT)(y * abs(phyyma-phyymi) / ypmm)); X} X X/* dcsc. define transformations between device coordinates and subpage */ X/* coordinates */ X XPLFLT dcscx(x) XPLFLT x; X{ X return((PLFLT)((x - spdxmi)/(spdxma-spdxmi))); X} X XPLFLT dcscy(y) XPLFLT y; X{ X return((PLFLT)((y - spdymi)/(spdyma-spdymi))); X} X X/* mmdc. converts millimetres from bottom left corner into device */ X/* coordinates */ X XPLFLT mmdcx(x) XPLFLT x; X{ X return((PLFLT)(x * xpmm / abs(phyxma - phyxmi))); X} X XPLFLT mmdcy(y) XPLFLT y; X{ X return((PLFLT)(y * ypmm / abs(phyyma - phyymi))); X} X X/* scdc. converts subpage coordinates to device coordinates */ X XPLFLT scdcx(x) XPLFLT x; X{ X return((PLFLT)(spdxmi + (spdxma-spdxmi) * x)); X} X XPLFLT scdcy(y) XPLFLT y; X{ X return((PLFLT)(spdymi + (spdyma-spdymi) * y)); X} X X/* wcmm. converts world coordinates into millimetres */ X XPLFLT wcmmx(x) XPLFLT x; X{ X return((PLFLT)(wmxoff + wmxscl*x)); X} X XPLFLT wcmmy(y) XPLFLT y; X{ X return((PLFLT)(wmyoff + wmyscl*y)); X} X XPLFLT w3wcx(x,y,z) XPLFLT x, y, z; X{ X return((PLFLT)((x-basecx)*cxx + (y-basecy)*cxy)); X} X XPLFLT w3wcy(x,y,z) XPLFLT x, y, z; X{ X return((PLFLT)((x-basecx)*cyx+(y-basecy)*cyy+(z-ranmi)*cyz)); X} X X END_OF_FILE if test 1522 -ne `wc -c <'src/fcnvrt.c'`; then echo shar: \"'src/fcnvrt.c'\" unpacked with wrong size! fi # end of 'src/fcnvrt.c' fi if test -f 'src/genlin.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/genlin.c'\" else echo shar: Extracting \"'src/genlin.c'\" \(1833 characters\) sed "s/^X//" >'src/genlin.c' <<'END_OF_FILE' X/* General line-drawing routine which takes line styles into account */ X X#include "plplot.h" X#include "declare.h" X#include <math.h> X Xstatic PLINT lastx=-100000, lasty=-100000; X Xvoid genlin(x1,y1,x2,y2) XPLINT x1,y1,x2,y2; X{ X PLINT nx,ny; X PLINT modulo, incr, dx, dy, diax, diay, i, temp, x, y; X PLINT px, py, tstep; X X/* Check for solid line */ X X if (nms == 0) { X grline(x1,y1,x2,y2); X return; X } X X/* Check if pattern needs to be restarted */ X X if (x1 != lastx || y1 != lasty) { X curel = 0; X pendn = 1; X timecnt = 0; X alarm = mark[curel]; X if (x1 == x2 && y1 == y2) grline(x1,y1,x2,y2); X } X X lastx = x1; X lasty = y1; X X if (x1 == x2 && y1 == y2) return; X X nx = x2 - x1; X ny = y2 - y1; X X if (abs(ny) > abs(nx)) { X modulo = abs(ny); X incr = abs(nx); X dx = 0; X dy = -1; X if (ny > 0) dy = 1; X } X else { X modulo = abs(nx); X incr = abs(ny); X dx = -1; X if (nx > 0) dx = 1; X dy = 0; X } X X diax = -1; X if (nx > 0) diax = 1; X diay = -1; X if (ny > 0) diay = 1; X X temp = modulo/2; X x = x1; X y = y1; X i = 1; X X/* Compute the timer step */ X X tstep = sqrt(pow((double)(abs(nx)*umx),2.)+ X pow((double)(abs(ny)*umy),2.))/modulo; X Xloop: X if (i > modulo) goto exit; X i = i+1; X temp = temp+incr; X px = x; X py = y; X if (temp > modulo) { X temp = temp-modulo; X x = x + diax; X y = y + diay; X } X else { X x = x + dx; X y = y + dy; X } X timecnt += tstep; X if (timecnt >= alarm) { X plupd(); X if (pendn == 0) grline(lastx,lasty,px,py); X lastx = x; X lasty = y; X } X goto loop; X Xexit: X if (pendn != 0) grline(lastx,lasty,x,y); X lastx = x2; X lasty = y2; X} X END_OF_FILE if test 1833 -ne `wc -c <'src/genlin.c'`; then echo shar: \"'src/genlin.c'\" unpacked with wrong size! fi # end of 'src/genlin.c' fi if test -f 'src/plbin.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plbin.c'\" else echo shar: Extracting \"'src/plbin.c'\" \(1807 characters\) sed "s/^X//" >'src/plbin.c' <<'END_OF_FILE' X/* Plot a histogram using the arrays x and y to represent data */ X/* values and frequencies respectively. If centre is false, x values */ X/* denote the lower edge of the bin, and if centre is true, they */ X/* they denote the centre of the bin */ X X#include "plplot.h" X#include <math.h> X Xvoid plbin(nbin,x,y,centre) XPLINT nbin; XPLINT centre; XPLFLT *x, *y; X{ X X PLINT i; X PLFLT xmin, xmax, vpwxmi, vpwxma, vpwymi, vpwyma; X PLINT level; X X glev(&level); X if (level<3)plexit("Please set up window before calling plbin."); X X /* Check x[i] are in ascending order */ X for(i=0;i<nbin-1;i++) X if (x[i] >= x[i+1]) X plexit("Elements of x[] must be increasing in plbin."); X X gvpw(&vpwxmi,&vpwxma,&vpwymi,&vpwyma); X if (!centre) { X for(i=0; i<nbin-1; i++){ X pljoin(x[i],vpwymi,x[i],y[i]); X pljoin(x[i],y[i],x[i+1],y[i]); X pljoin(x[i+1],y[i],x[i+1],vpwymi); X } X if (x[nbin-1] < vpwxma) { X pljoin(x[nbin-1],vpwymi,x[nbin-1],y[nbin-1]); X pljoin(x[nbin-1],y[nbin-1],vpwxma,y[nbin-1]); X pljoin(vpwxma,y[nbin-1],vpwxma,vpwymi); X } X } X else { X if (nbin < 2) return; X xmin = vpwxmi; X xmax = max(0.5*(x[1]+x[2]),vpwxmi); X if (xmin < xmax) { X pljoin(xmin,vpwymi,xmin,y[0]); X pljoin(xmin,y[0],xmax,y[0]); X pljoin(xmax,y[0],xmax,vpwymi); X } X for (i=1;i<nbin-1;i++) { X xmin = xmax; X xmax = min(0.5*(x[i]+x[i+1]),vpwxma); X pljoin(xmin,vpwymi,xmin,y[i]); X pljoin(xmin,y[i],xmax,y[i]); X pljoin(xmax,y[i],xmax,vpwymi); X } X xmin = xmax; X xmax = vpwxma; X if (xmin < xmax) { X pljoin(xmin,vpwymi,xmin,y[nbin-1]); X pljoin(xmin,y[nbin-1],xmax,y[nbin-1]); X pljoin(xmax,y[nbin-1],xmax,vpwymi); X } X } X} X END_OF_FILE if test 1807 -ne `wc -c <'src/plbin.c'`; then echo shar: \"'src/plbin.c'\" unpacked with wrong size! fi # end of 'src/plbin.c' fi if test -f 'src/plccal.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plccal.c'\" else echo shar: Extracting \"'src/plccal.c'\" \(1185 characters\) sed "s/^X//" >'src/plccal.c' <<'END_OF_FILE' X/* Subroutine to interpolate the position of a contour which is known */ X/* to be next to ix,iy in the direction ixg,iyg. The unscaled distance */ X/* along ixg,iyg is returned as dist */ X X#include "plplot.h" X Xvoid plccal(pts,nx,ny,zlev,ix,iy,ixg,iyg,dist) XPLINT nx,ny,ix,iy,ixg,iyg; XPLFLT *pts,zlev,*dist; X{ X PLINT ia,ib; X PLFLT dbot, dtop, pmid, qmid, zmid; X X ia = ix+ixg; X ib = iy+iyg; X if (ixg == 0 || iyg == 0) { X dtop = zlev - *(pts+(ix-1)*ny+iy-1); X dbot = *(pts+(ia-1)*ny+ib-1) - *(pts+(ix-1)*ny+iy-1); X *dist = 0.0; X if (dbot != 0.0) *dist = dtop/dbot; X } X else { X pmid = *(pts+(ix-1)*ny+iy-1) + *(pts+(ia-1)*ny+ib-1); X qmid = *(pts+(ix-1)*ny+ib-1) + *(pts+(ia-1)*ny+iy-1); X zmid = (pmid+qmid)/4.0; X if (zmid >= zlev) { X dtop = zlev - *(pts+(ix-1)*ny+iy-1); X dbot = zmid - *(pts+(ix-1)*ny+iy-1); X *dist = 0.0; X if (dbot != 0.0) *dist = 0.5*dtop/dbot; X } X else { X dtop = zlev-zmid; X dbot = *(pts+(ia-1)*ny+ib-1) - zmid; X *dist = 0.5; X if (dbot != 0.0) *dist = 0.5 + 0.5*dtop/dbot; X } X } X} END_OF_FILE if test 1185 -ne `wc -c <'src/plccal.c'`; then echo shar: \"'src/plccal.c'\" unpacked with wrong size! fi # end of 'src/plccal.c' fi if test -f 'src/plcont.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plcont.c'\" else echo shar: Extracting \"'src/plcont.c'\" \(1123 characters\) sed "s/^X//" >'src/plcont.c' <<'END_OF_FILE' X/* Draws a contour plot from data in z(nx,ny), using the subarray */ X/* from kx to lx in the x direction and from ky to ly in the y */ X/* direction. The array of contour levels is clevel(nlevel), and */ X/* "pltr" is the name of a subroutine which transforms array indicies */ X/* into world coordinates */ X X#include "plplot.h" X#include "declare.h" X#include <stdio.h> X#ifdef PLSTDC X#include <stdlib.h> X#else Xextern char *malloc(); Xextern void free(); X#endif X Xvoid plcont(z,nx,ny,kx,lx,ky,ly,clevel,nlevel,pltr) XPLINT nx, ny, kx, lx, ky, ly, nlevel; XPLFLT *z, *clevel; Xvoid (*pltr)(); X{ X PLINT i, mx, my, nstor, *heapc; X X mx = lx - kx + 1; X my = ly - ky + 1; X X if (kx < 1 || lx > nx || kx >= lx || ky < 1 || ky > ny || ky >= ly) X plexit("Argument error in plcont."); X X nstor = mx*my/5; X if(( heapc = (PLINT *)malloc((mx+2*nstor)*sizeof(PLINT))) == NULL) X plexit("Out of memory in plcont."); X for (i=0; i<nlevel; i++) { X plcntr(z,nx,ny,kx,lx,ky,ly,clevel[i],&heapc[0], X &heapc[nx],&heapc[nx+nstor],nstor,pltr); X } X free((VOID *)heapc); X X} END_OF_FILE if test 1123 -ne `wc -c <'src/plcont.c'`; then echo shar: \"'src/plcont.c'\" unpacked with wrong size! fi # end of 'src/plcont.c' fi if test -f 'src/pldtik.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/pldtik.c'\" else echo shar: Extracting \"'src/pldtik.c'\" \(1890 characters\) sed "s/^X//" >'src/pldtik.c' <<'END_OF_FILE' X/* If tick == 0, this works out a "nice" interval, so that there */ X/* are between 3 and 7.5 major tick intervals in the input range */ X/* "vmin" to "vmax". Using this value for the tick interval or */ X/* supplied value, it also computes "prec" which specifies */ X/* the number of places that should be written after the decimal */ X/* point. The recommended number of subticks is returned in */ X/* "nsubt" unless the routine is entered with a non-zero value */ X/* of "nsubt". The output variable "mode" is set to 0 if */ X/* labels are to be written in floating-point format, or to 1 if */ X/* they are to be written in fixed-point format. */ X X#include "plplot.h" X#include <math.h> X Xvoid pldtik(vmin, vmax, tick, nsubt, mode, prec) XPLFLT vmin, vmax, *tick; XPLINT *nsubt, *mode, *prec; X{ X X PLFLT t1, t2, vmod; X PLINT msd, np, ns; X X vmod = max(abs(vmin),abs(vmax)); X *mode = 0; X if (vmod < 1.0e-2 || vmod > 1.0e6) *mode = 1; X t1 = (PLFLT)log10(vmod); X msd = (PLINT)t1; X X t1 = (PLFLT)log10(abs(vmax-vmin)); X np = (PLINT)t1; X t1 = t1 - np; X X if (t1 > 0.7781512503) { X t2 = 2.0 ; X ns = 4; X } X else if (t1 > 0.4771212549) { X t2 = 1.0 ; X ns = 5; X } X else if (t1 > 0.1760912591) { X t2 = 5.0; X ns = 5; X np = np-1; X } X else { X t2 = 2.0; X ns = 4; X np = np-1; X } X X if (*tick == 0.0) { X *tick = t2 * pow(10.0,(double)np); X if (vmin > vmax) *tick = -*tick; X if (*nsubt == 0) *nsubt = ns; X if (*mode != 0) X *prec = msd - np; X else X *prec = max(-np,0); X } X else { X t1 = (PLFLT)log10(abs(*tick)); X np = (PLINT)t1; X if (*mode != 0) X *prec = msd - np + 1; X else X *prec = max(-np+1,0); X } X} X END_OF_FILE if test 1890 -ne `wc -c <'src/pldtik.c'`; then echo shar: \"'src/pldtik.c'\" unpacked with wrong size! fi # end of 'src/pldtik.c' fi if test -f 'src/plform.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plform.c'\" else echo shar: Extracting \"'src/plform.c'\" \(1232 characters\) sed "s/^X//" >'src/plform.c' <<'END_OF_FILE' X/* Formats a floating point value in one of the following formats */ X/* (i) If mode == 0, use floating point format with "precision" */ X/* places after the decimal point. */ X/* (ii) If mode == 1, use scientific notation with one place before */ X/* the decimal point and "precision" places after. */ X X#include "plplot.h" X#include <stdio.h> X#ifdef PLSTDC X#include <string.h> X#else Xextern char *strcpy(); Xextern char *strcat(); X#endif X Xstatic PLINT setpre, precis; X X/* Set the number of points written after the decimal point in labels */ X Xvoid plprec(setp,prec) XPLINT setp, prec; X{ X setpre = setp; X precis = prec; X} X Xvoid plform(value,mode,prec,result) XPLFLT value; XPLINT mode, prec; Xchar *result; X{ X PLINT j, expon; X char form[10]; X char temp[30]; X X if(setpre) X prec = precis; X X if (mode == 0) { X sprintf(form,"%%-.%df",prec); X sprintf(temp,form,value); X strcpy(result,temp); X } X else { X sprintf(form,"%%-.%dE",prec); X sprintf(temp,form,value); X j = strpos(temp,'E') + 1; X sscanf(&temp[j],"%d",&expon); X sprintf(form,"%-d",expon); X strcpy(&temp[j-1],"x10#u"); X strcat(temp,form); X strcpy(result,temp); X } X} X END_OF_FILE if test 1232 -ne `wc -c <'src/plform.c'`; then echo shar: \"'src/plform.c'\" unpacked with wrong size! fi # end of 'src/plform.c' fi if test -f 'src/plhist.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plhist.c'\" else echo shar: Extracting \"'src/plhist.c'\" \(1558 characters\) sed "s/^X//" >'src/plhist.c' <<'END_OF_FILE' X/* Draws a histogram of n values of a variable in array data[0..n-1] */ X/* in the range datmin to datmax using nbin bins. If "oldwin" is */ X/* 1, the histogram is plotted in the current window. If not, */ X/* the routine calls "plenv" to set up the graphics environment. */ X X#include "plplot.h" X#include <math.h> X#ifdef PLSTDC X#include <stdlib.h> X#else Xextern char *malloc(); Xextern void free(); X#endif X Xvoid plhist(n,data,datmin,datmax,nbin,oldwin) XPLINT n, nbin, oldwin; XPLFLT *data, datmin, datmax; X{ X PLINT bin, level; X PLFLT *x, *y, dx, ymax; X short i; X X glev(&level); X if (level<1) plexit("Please call plstar before plhist."); X if (level<3 && oldwin) X plexit("Please set up window before calling plhist."); X if (datmin >= datmax) X plexit("Data range invalid in plhist."); X X if(!(x = (PLFLT *)malloc(nbin*sizeof(PLFLT)))) X plexit("Out of memory in plhist"); X if(!(y = (PLFLT *)malloc(nbin*sizeof(PLFLT)))) X plexit("Out of memory in plhist"); X X dx = (datmax-datmin) / nbin; X for (i=0; i<nbin; i++) { X x[i] = datmin + i*dx; X y[i] = 0.0; X } X X for (i=0; i<n; i++) { X bin = (data[i] - datmin)/dx; X bin = bin > 0 ? bin : 0; X bin = bin < nbin ? bin : nbin-1; X y[bin]++; X } X X if (!oldwin) { X ymax = 0.0; X for (i=0; i<nbin; i++) ymax = max(ymax,y[i]); X plenv(datmin,datmax,0.0,1.1*ymax,0,0); X } X X plbin(nbin,x,y,0); X free((VOID *)x); X free((VOID *)y); X} X X END_OF_FILE if test 1558 -ne `wc -c <'src/plhist.c'`; then echo shar: \"'src/plhist.c'\" unpacked with wrong size! fi # end of 'src/plhist.c' fi if test -f 'src/plhrsh.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plhrsh.c'\" else echo shar: Extracting \"'src/plhrsh.c'\" \(964 characters\) sed "s/^X//" >'src/plhrsh.c' <<'END_OF_FILE' X/* Writes the Hershey symbol "ch" centred at the physical */ X/* coordinate (x,y) */ X X#include "plplot.h" X Xvoid plhrsh(ch,x,y) XPLINT ch, x, y; X{ X PLINT cx, cy, k, penup; X SCHAR *xygrid; X PLFLT symdef, symht, scale, xscale, yscale, xpmm, ypmm; X X gsym(&symdef,&symht); X gpixmm(&xpmm,&ypmm); X penup = 1; X scale = 0.05 * symht; X X if (!plcvec(ch,&xygrid)) { X movphy(x,y); X return; X } X X /* Compute how many physical pixels correspond to a character pixel */ X X xscale = scale * xpmm; X yscale = scale * ypmm; X X k = 4; X for(;;) { X cx = xygrid[k++]; X cy = xygrid[k++]; X if (cx == 64 && cy == 64) { X movphy(x,y); X return; X } X else if (cx == 64 && cy == 0) X penup = 1; X else { X if (penup != 0) { X movphy(round(x+xscale*cx),round(y+yscale*cy)); X penup = 0; X } X else X draphy(round(x+xscale*cx),round(y+yscale*cy)); X } X } X} X END_OF_FILE if test 964 -ne `wc -c <'src/plhrsh.c'`; then echo shar: \"'src/plhrsh.c'\" unpacked with wrong size! fi # end of 'src/plhrsh.c' fi if test -f 'src/pllclp.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/pllclp.c'\" else echo shar: Extracting \"'src/pllclp.c'\" \(1989 characters\) sed "s/^X//" >'src/pllclp.c' <<'END_OF_FILE' X/* Draws a (x1,y1) to (x2,y2) within the clip limits */ X X#include "plplot.h" X X#define betw(ix,ia,ib) ((ix<=ia && ix>=ib) || (ix>=ia && ix<=ib)) X#define inside(ix,iy) (betw(ix,clpxmi,clpxma) && betw(iy,clpymi,clpyma)) X Xvoid pllclp(x1,y1,x2,y2) XPLINT x1,y1,x2,y2; X{ X PLINT clpxmi,clpxma,clpymi,clpyma; X PLINT t,dx,dy,flipx,flipy; X PLFLT slope; X X scurr(x2,y2); X gclp(&clpxmi,&clpxma,&clpymi,&clpyma); X X if(inside(x1,y1) && inside(x2,y2)) { X genlin(x1,y1,x2,y2); X return; X } X X if((x1 <= clpxmi && x2 <= clpxmi)||(x1 >= clpxma && x2 >= clpxma)) X return; X if((y1 <= clpymi && y2 <= clpymi)||(y1 >= clpyma && y2 >= clpyma)) X return; X X flipx = 0; flipy = 0; X X if(x2 < x1) { X x1 = 2*clpxmi - x1; X x2 = 2*clpxmi - x2; X clpxma = 2*clpxmi - clpxma; X t = clpxma; clpxma = clpxmi; clpxmi = t; X flipx = 1; X } X X if(y2 < y1) { X y1 = 2*clpymi - y1; X y2 = 2*clpymi - y2; X clpyma = 2*clpymi - clpyma; X t = clpyma; clpyma = clpymi; clpymi = t; X flipy = 1; X } X X dx = x2 - x1; dy = y2 - y1; X X if(dx != 0) X slope = (PLFLT)dy/(PLFLT)dx; X X if(x1 < clpxmi) { X if(dx != 0 && dy != 0) X y1 = y1 + round(slope*(clpxmi-x1)); X x1 = clpxmi; X } X X if(y1 < clpymi) { X if(dx != 0 && dy != 0) X x1 = x1 + round((clpymi-y1)/slope); X y1 = clpymi; X } X X if(x1 >= clpxma || y1 >= clpyma) X return; X X if(y2 > clpyma) { X if(dx != 0 && dy != 0) X x2 = x2 - round((y2 - clpyma)/slope); X y2 = clpyma; X } X X if(x2 > clpxma) { X if(dx != 0 && dy != 0) X y2 = y2 - round((x2 - clpxma)*slope); X x2 = clpxma; X } X X if(flipx) { X x1 = 2*clpxma - x1; X x2 = 2*clpxma - x2; X clpxmi = 2*clpxma - clpxmi; X t = clpxma; clpxma = clpxmi; clpxmi = t; X } X X if(flipy) { X y1 = 2*clpyma - y1; X y2 = 2*clpyma - y2; X clpymi = 2*clpyma - clpymi; X t = clpyma; clpyma = clpymi; clpymi = t; X } X X genlin(x1,y1,x2,y2); X} END_OF_FILE if test 1989 -ne `wc -c <'src/pllclp.c'`; then echo shar: \"'src/pllclp.c'\" unpacked with wrong size! fi # end of 'src/pllclp.c' fi if test -f 'src/pllsty.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/pllsty.c'\" else echo shar: Extracting \"'src/pllsty.c'\" \(976 characters\) sed "s/^X//" >'src/pllsty.c' <<'END_OF_FILE' X/* Sets fill pattern */ X X#include "plplot.h" X Xstatic struct line { X PLINT nels; X PLINT mark[4]; X PLINT space[4]; X} line[] = { X { X 0, /* Continuous line */ X 0, 0, 0, 0, X 0, 0, 0, 0 X }, X { X 1, X 1000, 0, 0, 0, X 1000, 0, 0, 0 X }, X { X 1, X 2000, 0, 0, 0, X 2000, 0, 0, 0 X }, X { X 1, X 2000, 0, 0, 0, X 1000, 0, 0, 0 X }, X { X 2, X 2500, 1000, 0, 0, X 1000, 1000, 0, 0 X }, X { X 2, X 2000, 1000, 0, 0, X 2000, 1000, 0, 0 X }, X { X 3, X 1000, 1500, 2000, 0, X 1000, 1500, 2000, 0 X }, X { X 3, X 1000, 1500, 2000, 0, X 1000, 1000, 1000, 0 X } X}; X Xvoid pllsty(lin) XPLINT lin; X{ X PLINT level; X X glev(&level); X if (level < 1) plexit("Please call plstar before calling pllsty."); X if (lin < 1 || lin > 8) X plexit("Invalid line in pllsty."); X plstyl(line[lin-1].nels,&line[lin-1].mark[0],&line[lin-1].space[0]); X X} END_OF_FILE if test 976 -ne `wc -c <'src/pllsty.c'`; then echo shar: \"'src/pllsty.c'\" unpacked with wrong size! fi # end of 'src/pllsty.c' fi if test -f 'src/plpsty.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plpsty.c'\" else echo shar: Extracting \"'src/plpsty.c'\" \(987 characters\) sed "s/^X//" >'src/plpsty.c' <<'END_OF_FILE' X/* Sets fill pattern */ X X#include "plplot.h" X Xstatic struct pattern { X PLINT nlines; /* Number of lines in pattern (1 or 2) */ X PLINT inc[2]; /* Inclination 10 ths of degrees */ X PLINT del[2]; /* Spacing for each line */ X} pattern[] = { X { X 1, X 0, 0, X 2000, 0 X }, X { X 1, X 900, 0, X 2000, 0 X }, X { X 1, X 450, 0, X 2000, 0 X }, X { X 1, X -450, 0, X 2000, 0 X }, X { X 1, X 300, 0, X 2000, 0 X }, X { X 1, X -300, 0, X 2000, 0 X }, X { X 2, X 0, 900, X 2000, 2000 X }, X { X 2, X 450, -450, X 2000, 2000 X } X}; X Xvoid plpsty(patt) XPLINT patt; X{ X PLINT level; X X glev(&level); X if (level < 1) plexit("Please call plstar before calling plpsty."); X if (patt < 1 || patt > 8) X plexit("Invalid pattern in plpsty."); X plpat(pattern[patt-1].nlines,&pattern[patt-1].inc[0], X &pattern[patt-1].del[0]); X X} END_OF_FILE if test 987 -ne `wc -c <'src/plpsty.c'`; then echo shar: \"'src/plpsty.c'\" unpacked with wrong size! fi # end of 'src/plpsty.c' fi if test -f 'src/plptex.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plptex.c'\" else echo shar: Extracting \"'src/plptex.c'\" \(1332 characters\) sed "s/^X//" >'src/plptex.c' <<'END_OF_FILE' X/* Prints out "text" at world cooordinate (x,y). The text may be */ X/* at any angle "angle" relative to the horizontal. The parameter */ X/* "just" adjusts the horizontal justification of the string: */ X/* just = 0.0 => left hand edge of string is at (x,y) */ X/* just = 1.0 => right hand edge of string is at (x,y) */ X/* just = 0.5 => centre of string is at (x,y) etc. */ X/* N.B. Centreline of the string passes through (x,y) */ X X#include "plplot.h" X#include <math.h> X Xvoid plptex(x,y,dx,dy,just,text) XPLFLT x,y,dx,dy,just; Xchar *text; X{ X PLINT refx, refy; X PLFLT shift, cc, ss; X PLFLT xform[4],diag; X PLFLT xscl, xoff, yscl, yoff; X PLINT level; X X glev(&level); X if (level < 3) plexit("Please set up window before calling plptex."); X X gwm(&xscl,&xoff,&yscl,&yoff); X cc = xscl * dx; X ss = yscl * dy; X diag = sqrt(cc*cc + ss*ss); X cc = cc/diag; X ss = ss/diag; X X gmp(&xscl,&xoff,&yscl,&yoff); X shift = 0.0; X X xform[0] = cc; X xform[1] = -ss; X xform[2] = ss; X xform[3] = cc; X X if (just != 0.0) shift = plstrl(text) * just; X refx = wcpcx(x) - shift * cc * xscl; X refy = wcpcy(y) - shift * ss * yscl; X plstr(0,xform,refx,refy,text); X} END_OF_FILE if test 1332 -ne `wc -c <'src/plptex.c'`; then echo shar: \"'src/plptex.c'\" unpacked with wrong size! fi # end of 'src/plptex.c' fi if test -f 'src/plstrl.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plstrl.c'\" else echo shar: Extracting \"'src/plstrl.c'\" \(1020 characters\) sed "s/^X//" >'src/plstrl.c' <<'END_OF_FILE' X/* Computes the length of a string in mm, including escape sequences */ X X#include "plplot.h" X#include <math.h> X XPLFLT plstrl(string) Xchar *string; X{ X short int *symbol; X SCHAR *xygrid; X PLINT ch, i, length, level; X PLFLT width, xorg, dscale, scale, def, ht; X PLFLT xscl, xoff, yscl, yoff; X X width = 0.0; X gchr(&def,&ht); X dscale = 0.05*ht; X scale = dscale; X gmp(&xscl,&xoff,&yscl,&yoff); X X pldeco(&symbol,&length,string); X xorg = 0.0; X level = 0; X X for (i=0; i<length; i++) { X ch = symbol[i]; X if (ch == -1) { X level = level + 1; X scale = dscale * pow(0.75,(double)abs(level)); X } X else if (ch == -2) { X level = level - 1; X scale = dscale * pow(0.75,(double)abs(level)); X } X else if (ch == -3) X xorg = xorg - width * scale; X else if (ch == -4 || ch == -5) X ; X else { X if (plcvec(ch,&xygrid)) { X width = xygrid[3] - xygrid[2]; X xorg = xorg + width*scale; X } X } X } X return((PLFLT)xorg); X} END_OF_FILE if test 1020 -ne `wc -c <'src/plstrl.c'`; then echo shar: \"'src/plstrl.c'\" unpacked with wrong size! fi # end of 'src/plstrl.c' fi if test -f 'src/plstyl.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plstyl.c'\" else echo shar: Extracting \"'src/plstyl.c'\" \(1175 characters\) sed "s/^X//" >'src/plstyl.c' <<'END_OF_FILE' X/* Set up a new line style of "nels" elements, with mark and space */ X/* lengths given by arrays "mk" and "sp". */ X X#include "plplot.h" X#include "declare.h" X Xvoid plstyl(nels,mk,sp) XPLINT nels, *mk, *sp; X{ X short int i; X PLINT level; X X glev(&level); X if (level < 1) plexit("Please call plstar before calling plstyl."); X X if ((nels < 0) || (nels > 10)) { X plexit("Broken lines cannot have <0 or >10 elements"); X } X X nms = nels; X for (i=0; i<nels; i++) { X mark[i] = mk[i]; X space[i] = sp[i]; X if ((mk[i] < 0) || (sp[i] < 0)) X plexit("Mark and space lengths must be > 0 in plstyl."); X } X X curel = 0; X pendn = 1; X timecnt = 0; X alarm = mark[curel]; X} X X/* Updates line style variables, called whenever alarm goes off */ X Xvoid plupd() X{ X while ( timecnt >= alarm ) { X if (pendn != 0) { X pendn = 0; X timecnt = timecnt - alarm; X alarm = space[curel]; X } X else { X pendn = 1; X timecnt = timecnt - alarm; X curel = curel + 1; X if (curel >= nms) curel = 0; X alarm = mark[curel]; X } X } X} X X END_OF_FILE if test 1175 -ne `wc -c <'src/plstyl.c'`; then echo shar: \"'src/plstyl.c'\" unpacked with wrong size! fi # end of 'src/plstyl.c' fi if test -f 'src/plsvpa.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plsvpa.c'\" else echo shar: Extracting \"'src/plsvpa.c'\" \(1218 characters\) sed "s/^X//" >'src/plsvpa.c' <<'END_OF_FILE' X/* Sets the edges of the viewport to the specified absolute */ X/* coordinates (mm), measured with respect to the current subpage */ X/* boundaries */ X X#include "plplot.h" X Xvoid plsvpa(xmin,xmax,ymin,ymax) XPLFLT xmin, xmax, ymin, ymax; X{ X X PLINT nx, ny, cs; X PLFLT sxmin, symin; X PLFLT spdxmi, spdxma, spdymi, spdyma; X PLFLT vpdxmi, vpdxma, vpdymi, vpdyma; X PLINT level; X X glev(&level); X if (level<1) plexit("Please call PLSTAR before calling plsvpa."); X if((xmin>=xmax)||(ymin>=ymax)||(xmin<0.)||(ymin<0.)) X plexit("Invalid limits in plsvpa."); X X gsub(&nx,&ny,&cs); X if ((cs<=0) || (cs>(nx*ny))) X plexit("Please call pladv or plenv to go to a subpage."); X X gspd(&spdxmi,&spdxma,&spdymi,&spdyma); X sxmin = dcmmx(spdxmi); X symin = dcmmy(spdymi); X X vpdxmi = mmdcx((PLFLT)(sxmin+xmin)); X vpdxma = mmdcx((PLFLT)(sxmin+xmax)); X vpdymi = mmdcy((PLFLT)(symin+ymin)); X vpdyma = mmdcy((PLFLT)(symin+ymax)); X X svpd(vpdxmi,vpdxma,vpdymi,vpdyma); X svpp(dcpcx(vpdxmi),dcpcx(vpdxma),dcpcy(vpdymi),dcpcy(vpdyma)); X sclp(dcpcx(vpdxmi),dcpcx(vpdxma),dcpcy(vpdymi),dcpcy(vpdyma)); X slev(2); X} X END_OF_FILE if test 1218 -ne `wc -c <'src/plsvpa.c'`; then echo shar: \"'src/plsvpa.c'\" unpacked with wrong size! fi # end of 'src/plsvpa.c' fi if test -f 'src/plvpor.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plvpor.c'\" else echo shar: Extracting \"'src/plvpor.c'\" \(1172 characters\) sed "s/^X//" >'src/plvpor.c' <<'END_OF_FILE' X/* Sets the edges of the viewport to the specified normalized subpage */ X/* coordinates */ X X#include "plplot.h" X Xvoid plvpor(xmin, xmax, ymin, ymax) XPLFLT xmin, xmax, ymin, ymax; X{ X PLFLT spdxmi, spdxma, spdymi, spdyma; X PLFLT vpdxmi, vpdxma, vpdymi, vpdyma; X PLINT vppxmi, vppxma, vppymi, vppyma; X PLINT nx, ny, cs; X PLINT level; X X glev(&level); X if (level < 1) plexit("Please call plstar before calling plvpor."); X if((xmin>=xmax)||(ymin>=ymax)||(xmin<0.)|| X (ymin<0.)||(xmax>1.)||(ymax>1.)) X plexit("Invalid limits in plsvpa."); X X gsub(&nx,&ny,&cs); X if ((cs<=0) || (cs>(nx*ny))) X plexit("Please call pladv or plenv to go to a subpage."); X gspd(&spdxmi,&spdxma,&spdymi,&spdyma); X vpdxmi = spdxmi + (spdxma - spdxmi) * xmin; X vpdxma = spdxmi + (spdxma - spdxmi) * xmax; X vpdymi = spdymi + (spdyma - spdymi) * ymin; X vpdyma = spdymi + (spdyma - spdymi) * ymax; X svpd(vpdxmi,vpdxma,vpdymi,vpdyma); X X vppxmi = dcpcx(vpdxmi); X vppxma = dcpcx(vpdxma); X vppymi = dcpcy(vpdymi); X vppyma = dcpcy(vpdyma); X svpp(vppxmi,vppxma,vppymi,vppyma); X sclp(vppxmi,vppxma,vppymi,vppyma); X slev(2); X} END_OF_FILE if test 1172 -ne `wc -c <'src/plvpor.c'`; then echo shar: \"'src/plvpor.c'\" unpacked with wrong size! fi # end of 'src/plvpor.c' fi if test -f 'src/plwind.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plwind.c'\" else echo shar: Extracting \"'src/plwind.c'\" \(1555 characters\) sed "s/^X//" >'src/plwind.c' <<'END_OF_FILE' X#include "plplot.h" X Xvoid plwind(xmin,xmax,ymin,ymax) XPLFLT xmin, xmax, ymin, ymax; X{ X PLINT vppxmi, vppxma, vppymi, vppyma; X PLFLT dx, dy; X PLFLT vpwxmi, vpwxma, vpwymi, vpwyma; X PLFLT vpxmi, vpxma, vpymi, vpyma; X PLFLT wpxscl, wpxoff, wpyscl, wpyoff; X PLFLT wmxscl, wmxoff, wmyscl, wmyoff; X PLINT level; X X glev(&level); X if (level<2) plexit("Please set up viewport before calling plwind."); X X gvpp(&vppxmi,&vppxma,&vppymi,&vppyma); X gvpd(&vpxmi,&vpxma,&vpymi,&vpyma); X X dx = (xmax-xmin) * 1.0e-5; X dy = (ymax-ymin) * 1.0e-5; X X if ((xmin == xmax) || (ymin == ymax)) X plexit("Invalid window limits in plwind."); X X/* The true plot window is made slightly larger than requested so that */ X/* the end limits will be on the graph */ X X svpw((PLFLT)(xmin-dx),(PLFLT)(xmax+dx),(PLFLT)(ymin-dy),(PLFLT)(ymax+dy)); X gvpw(&vpwxmi,&vpwxma,&vpwymi,&vpwyma); X X/* Compute the scaling between coordinate systems */ X X dx = vpwxma - vpwxmi; X dy = vpwyma - vpwymi; X X wpxscl = (vppxma - vppxmi) / dx; X wpxoff = (xmax * vppxmi - xmin * vppxma) / dx; X wpyscl = (vppyma - vppymi) / dy; X wpyoff = (ymax * vppymi - ymin * vppyma) / dy; X swp(wpxscl,wpxoff,wpyscl,wpyoff); X X vpxmi = dcmmx(vpxmi); X vpxma = dcmmx(vpxma); X vpymi = dcmmy(vpymi); X vpyma = dcmmy(vpyma); X wmxscl = (vpxma - vpxmi) / dx; X wmxoff = (xmax * vpxmi - xmin * vpxma) / dx; X wmyscl = (vpyma - vpymi) / dy; X wmyoff = (ymax * vpymi - ymin * vpyma) / dy; X swm(wmxscl,wmxoff,wmyscl,wmyoff); X X slev(3); X} END_OF_FILE if test 1555 -ne `wc -c <'src/plwind.c'`; then echo shar: \"'src/plwind.c'\" unpacked with wrong size! fi # end of 'src/plwind.c' fi if test -f 'src/plxytx.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plxytx.c'\" else echo shar: Extracting \"'src/plxytx.c'\" \(971 characters\) sed "s/^X//" >'src/plxytx.c' <<'END_OF_FILE' X/* Prints out text along a sloping axis joining world coordinates */ X/* (wx1,wy1) to (wx2,wy2). Parameters are as for plmtext */ X X#include "plplot.h" X#include <math.h> X Xvoid plxytx(wx1,wy1,wx2,wy2,disp,pos,just,text) XPLFLT wx1,wy1,wx2,wy2,disp,pos,just; Xchar *text; X{ X PLINT refx, refy; X PLFLT shift, cc, ss, def, ht; X PLFLT xform[4], diag; X PLFLT xscl, xoff, yscl, yoff, wx, wy; X X gchr(&def,&ht); X gwm(&xscl,&xoff,&yscl,&yoff); X cc = xscl * (wx2-wx1); X ss = yscl * (wy2-wy1); X diag = sqrt(cc*cc + ss*ss); X cc = cc/diag; X ss = ss/diag; X X xform[0] = cc; X xform[1] = 0.0; X xform[2] = ss; X xform[3] = 1.0; X X shift = 0.0; X if (just != 0.0) shift = plstrl(text) * just; X wx = wx1 + pos * (wx2 - wx1); X wy = wy1 + pos * (wy2 - wy1); X X refx = mmpcx(wcmmx(wx) - shift * cc); X refy = mmpcy(wcmmy(wy) - shift * ss - disp * ht); X plstr(0,xform,refx,refy,text); X} END_OF_FILE if test 971 -ne `wc -c <'src/plxytx.c'`; then echo shar: \"'src/plxytx.c'\" unpacked with wrong size! fi # end of 'src/plxytx.c' fi if test -f 'src/plztx.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/plztx.c'\" else echo shar: Extracting \"'src/plztx.c'\" \(1406 characters\) sed "s/^X//" >'src/plztx.c' <<'END_OF_FILE' X/* Prints out text along a vertical axis for a 3d plot joining */ X/* world coordinates (wx,wy1) to (wx,wy2). */ X X#include "plplot.h" X#include <math.h> X Xvoid plztx(opt,dx,dy,wx,wy1,wy2,disp,pos,just,text) XPLFLT dx,dy,wx,wy1,wy2,disp,pos,just; Xchar *opt, *text; X{ X PLINT refx, refy; X PLINT vert; X PLFLT shift, cc, ss, def, ht; X PLFLT xform[4], diag; X PLFLT xscl, xoff, yscl, yoff, wy; X X gchr(&def,&ht); X gwm(&xscl,&xoff,&yscl,&yoff); X cc = xscl * dx; X ss = yscl * dy; X diag = sqrt(cc*cc + ss*ss); X cc = cc/diag; X ss = ss/diag; X gmp(&xscl,&xoff,&yscl,&yoff); X X shift = 0.0; X if (just != 0.0) shift = plstrl(text) * just; X wy = wy1 + pos * (wy2 - wy1); X X if (stsearch(opt,'v')) { X vert = 0; X refx = mmpcx((PLFLT)(wcmmx(wx) - (disp * ht + shift) * cc)); X refy = mmpcy((PLFLT)(wcmmy(wy) - (disp * ht + shift) * ss)); X } X else if (stsearch(opt,'h')) { X vert = 1; X refy = wcpcy(wy) - yscl*(disp*ht*ss+shift); X refx = mmpcx((PLFLT)(wcmmx(wx) - disp*ht*cc)); X } X if (vert) { X xform[0] = 0.0; X xform[1] = -cc; X xform[2] = 1.0; X xform[3] = -ss; X } X else { X xform[0] = cc; X xform[1] = 0.0; X xform[2] = ss; X xform[3] = 1.0; X } X plstr(0,xform,refx,refy,text); X} END_OF_FILE if test 1406 -ne `wc -c <'src/plztx.c'`; then echo shar: \"'src/plztx.c'\" unpacked with wrong size! fi # end of 'src/plztx.c' fi if test -f 'unix/dg300.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unix/dg300.c'\" else echo shar: Extracting \"'unix/dg300.c'\" \(1620 characters\) sed "s/^X//" >'unix/dg300.c' <<'END_OF_FILE' X#include "plplot.h" X#include <stdio.h> X#include <string.h> X#include <limits.h> X Xstruct termattr { X unsigned char com[4]; X unsigned char rom[4]; X unsigned char ram[4]; X unsigned char con[5]; X unsigned char eor; X} termattr; X X#define DGX 639 X#define DGY 239 X Xvoid dgsetup(xdpi,ydpi,xwid,ywid) XPLINT xwid, ywid; XPLFLT xdpi, ydpi; X{ X} X Xvoid dginit() X{ X /* Request terminal configuration report */ X printf("\n\036\107\051\n"); X scanf("%s",(char *)&termattr); X while(getchar() != '\n') X ; X if(!strncmp((char *)&termattr.ram[0],"0000",4)) { X printf("Please wait while graphics interpreter is downloaded.\n"); X /* Need to download graphics interpreter. */ X system("cat /usr/local/src/g300/g300gci110.tx"); X } X X /* Clear screen, Set pen color to green, Absolute positioning */ X printf("\036\107\063\060\n\036\107\155\061\n\036\107\151\060\n"); X printf("\036\107\042\061\n"); X X /* set plplot stuff */ X smod(1); /* interaction mode */ X scol(1); /* color */ X swid(1); X setpxl(3.316*16,1.655*16); X setphy(0,DGX*16,0,DGY*16); X} X Xvoid dgselect(ori,file) XPLINT ori; Xchar *file; X{ X} X Xvoid dgtext() X{ X} X Xvoid dggraph() X{ X} X Xvoid dgclear() X{ X /* Before clearing wait for CR */ X putchar('\007'); X fflush(stdout); X while(getchar() != '\n') X ; X printf("ERASE\n"); X} X Xvoid dgpage() X{ X} X Xvoid dgcolor(colour) XPLINT colour; X{ X} X Xvoid dgline(x1,y1,x2,y2) XPLINT x1,y1,x2,y2; X{ X printf("LINE %d %d %d %d\n",x1>>4,y1>>3,x2>>4,y2>>3); X} X Xvoid dgtidy() X{ X dgclear(); X printf("\036\107\042\060\n"); X fflush(stdout); X} X Xvoid dgwidth(width) XPLINT width; X{ X} X END_OF_FILE if test 1620 -ne `wc -c <'unix/dg300.c'`; then echo shar: \"'unix/dg300.c'\" unpacked with wrong size! fi # end of 'unix/dg300.c' fi echo shar: End of archive 2 \(of 12\). cp /dev/null ark2isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 12 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to: amiga@cs.odu.edu or amiga@xanth.cs.odu.edu ( obsolescent mailers may need this address ) or ...!uunet!xanth!amiga ( very obsolescent mailers need this address ) Comments, questions, and suggestions s should be addressed to ``amiga-request'' (only use ``amiga'' for submissions) at the above addresses.