home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / gnuplot / part15 < prev    next >
Encoding:
Text File  |  1993-10-22  |  80.9 KB  |  2,906 lines

  1. Newsgroups: comp.sources.misc
  2. From: woo@playfair.stanford.edu ("Alexander Woo")
  3. Subject: v40i027:  gnuplot - interactive function plotting utility, Part15/33
  4. Message-ID: <1993Oct22.163506.23965@sparky.sterling.com>
  5. X-Md4-Signature: 5db1ac65167533ce5763e82cb8f46637
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Fri, 22 Oct 1993 16:35:06 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
  12. Posting-number: Volume 40, Issue 27
  13. Archive-name: gnuplot/part15
  14. Environment: UNIX, MS-DOS, VMS
  15. Supersedes: gnuplot3: Volume 24, Issue 23-48
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  gnuplot/demo/prob2.dem gnuplot/docs/gpcard.tex
  22. #   gnuplot/term/pc.trm
  23. # Wrapped by kent@sparky on Wed Oct 20 17:14:50 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 15 (of 33)."'
  27. if test -f 'gnuplot/demo/prob2.dem' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'gnuplot/demo/prob2.dem'\"
  29. else
  30.   echo shar: Extracting \"'gnuplot/demo/prob2.dem'\" \(10444 characters\)
  31.   sed "s/^X//" >'gnuplot/demo/prob2.dem' <<'END_OF_FILE'
  32. X#
  33. X# $Id: prob2.demo 3.38.2.6 1992/11/14 02:25:21 woo Exp $
  34. X#
  35. X# Demo Statistical Approximations version 1.1
  36. X#
  37. X# Permission granted to distribute freely for non-commercial purposes only
  38. X#
  39. X# Copyright (c) 1991, Jos van der Woude, jvdwoude@hut.nl
  40. X
  41. Xpause  0 ""
  42. Xpause  0 ""
  43. Xpause  0 ""
  44. Xpause  0 ""
  45. Xpause  0 ""
  46. Xpause  0 ""
  47. Xpause  0 "                        Statistical Approximations, version 1.1"
  48. Xpause  0 ""
  49. Xpause  0 "        Copyright (c) 1991, 1992, Jos van de Woude, jvdwoude@hut.nl"
  50. Xpause  0 ""
  51. Xpause  0 ""
  52. Xpause  0 " Permission granted to distribute freely for non-commercial purposes only"
  53. Xpause  0 ""
  54. Xpause  0 ""
  55. Xpause  0 ""
  56. Xpause  0 ""
  57. Xpause  0 ""
  58. Xpause  0 ""
  59. Xpause  0 ""
  60. Xpause  0 ""
  61. Xpause  0 ""
  62. Xpause  0 "     NOTE: contains 10 plots and consequently takes some time to run"
  63. Xpause  0 "                      Press Ctrl-C to exit right now"
  64. Xpause  0 ""
  65. Xpause -1 "                      Press Return to start demo ..."
  66. Xsave set "defaults.ini"
  67. X
  68. Xload "stat.inc"
  69. X
  70. X# Binomial PDF using normal approximation
  71. Xn = 25; p = 0.15
  72. Xmu = n * p
  73. Xsigma = sqrt(n * p * (1.0 - p))
  74. Xxmin = floor(mu - 4.0 * sigma)
  75. Xxmin = xmin < 0 ? 0 : xmin
  76. Xxmax = ceil(mu + 4.0 * sigma)
  77. Xymax = 1.1 * binom(mu) #mode of binomial PDF used
  78. Xxinc = ceil((xmax - xmin) / 10)
  79. Xxinc = xinc > 1 ? xinc : 1
  80. Xset key
  81. Xset nozeroaxis
  82. Xset xrange [xmin - 1 : xmax + 1]
  83. Xset yrange [0 : ymax]
  84. Xset xlabel "k, x ->"
  85. Xset ylabel "probability density ->"
  86. Xset xtics xmin + 0.499, ceil(sigma), xmax
  87. Xset ytics 0, ymax / 10.0, ymax
  88. Xset format x "%2.0f"
  89. Xset format y "%3.2f"
  90. Xset sample 200
  91. Xset title "binomial PDF using normal approximation"
  92. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  93. Xset arrow from mu + 0.5, normal(mu + sigma) \
  94. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  95. Xset label "mu" at mu + 1, ymax / 10
  96. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  97. Xplot binom(x), normal(x - 0.5)
  98. Xpause -1 "Hit return to continue"
  99. Xset noarrow
  100. Xset nolabel
  101. X
  102. X# Binomial PDF using poisson approximation
  103. Xn = 50; p = 0.1
  104. Xmu = n * p
  105. Xsigma = sqrt(mu)
  106. Xxmin = floor(mu - 4.0 * sigma)
  107. Xxmin = xmin < 0 ? 0 : xmin
  108. Xxmax = ceil(mu + 4.0 * sigma)
  109. Xymax = 1.1 * binom(mu) #mode of binomial PDF used
  110. Xxinc = ceil((xmax - xmin) / 10)
  111. Xxinc = xinc > 1 ? xinc : 1
  112. Xset key
  113. Xset nozeroaxis
  114. Xset xrange [xmin - 1 : xmax + 1]
  115. Xset yrange [0 : ymax]
  116. Xset xlabel "k ->"
  117. Xset ylabel "probability density ->"
  118. Xset xtics xmin + 0.499, ceil(sigma), xmax
  119. Xset ytics 0, ymax / 10.0, ymax
  120. Xset format x "%2.0f"
  121. Xset format y "%3.2f"
  122. Xset sample 200
  123. Xset title "binomial PDF using poisson approximation"
  124. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  125. Xset arrow from mu + 0.5, normal(mu + sigma) \
  126. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  127. Xset label "mu" at mu + 1, ymax / 10
  128. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  129. Xplot binom(x), poisson(x)
  130. Xpause -1 "Hit return to continue"
  131. Xset noarrow
  132. Xset nolabel
  133. X
  134. X# Geometric PDF using gamma approximation
  135. Xp = 0.3
  136. Xmu = (1.0 - p) / p
  137. Xsigma = sqrt(mu / p)
  138. Xlambda = p
  139. Xrho = 1.0 - p
  140. Xxmin = floor(mu - 4.0 * sigma)
  141. Xxmin = xmin < 0 ? 0 : xmin
  142. Xxmax = ceil(mu + 4.0 * sigma)
  143. Xxinc = ceil((xmax - xmin) / 10)
  144. Xxinc = xinc > 1 ? xinc : 1
  145. Xymax = 1.1 * p
  146. Xset key
  147. Xset nozeroaxis
  148. Xset xrange [xmin - 1 : xmax + 1]
  149. Xset yrange [0 : ymax]
  150. Xset xlabel "k, x ->"
  151. Xset ylabel "probability density ->"
  152. Xset xtics xmin + 0.499, ceil((xmax - xmin)/ 10.0), xmax
  153. Xset ytics 0, ymax / 10.0, ymax
  154. Xset format x "%2.0f"
  155. Xset format y "%3.2f"
  156. Xset sample 200
  157. Xset title "geometric PDF using gamma approximation"
  158. Xset arrow from mu + 0.5, 0 to mu + 0.5, g(mu) nohead
  159. Xset arrow from mu + 0.5, g(mu + sigma) \
  160. X          to mu + 0.5 + sigma, g(mu + sigma) nohead
  161. Xset label "mu" at mu + 1, ymax / 10
  162. Xset label "sigma" at mu + 1 + sigma, g(mu + sigma)
  163. Xplot geometric(x), g(x - 0.5)
  164. Xpause -1 "Hit return to continue"
  165. Xset noarrow
  166. Xset nolabel
  167. X
  168. X# Geometric PDF using normal approximation
  169. Xp = 0.3
  170. Xmu = (1.0 - p) / p
  171. Xsigma = sqrt(mu / p)
  172. Xxmin = floor(mu - 4.0 * sigma)
  173. Xxmin = xmin < 0 ? 0 : xmin
  174. Xxmax = ceil(mu + 4.0 * sigma)
  175. Xxinc = ceil((xmax - xmin) / 10)
  176. Xxinc = xinc > 1 ? xinc : 1
  177. Xymax = 1.1 * p
  178. Xset key
  179. Xset nozeroaxis
  180. Xset xrange [xmin - 1 : xmax + 1]
  181. Xset yrange [0 : ymax]
  182. Xset xlabel "k, x ->"
  183. Xset ylabel "probability density ->"
  184. Xset xtics xmin + 0.499, ceil((xmax - xmin)/ 10.0), xmax
  185. Xset ytics 0, ymax / 10.0, ymax
  186. Xset format x "%2.0f"
  187. Xset format y "%3.2f"
  188. Xset sample 200
  189. Xset title "geometric PDF using normal approximation"
  190. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  191. Xset arrow from mu + 0.5, normal(mu + sigma) \
  192. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  193. Xset label "mu" at mu + 1, ymax / 10
  194. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  195. Xplot geometric(x), normal(x - 0.5)
  196. Xpause -1 "Hit return to continue"
  197. Xset noarrow
  198. Xset nolabel
  199. X
  200. X# Hypergeometric PDF using binomial approximation
  201. Xnn = 75; mm = 25; n = 10
  202. Xp = real(mm) / nn
  203. Xmu = n * p
  204. Xsigma = sqrt(real(nn - n) / (nn - 1.0) * n * p * (1.0 - p))
  205. Xxmin = floor(mu - 4.0 * sigma)
  206. Xxmin = xmin < 0 ? 0 : xmin
  207. Xxmax = ceil(mu + 4.0 * sigma)
  208. Xxinc = ceil((xmax - xmin) / 10)
  209. Xxinc = xinc > 1 ? xinc : 1
  210. Xymax = 1.1 * hypgeo(mu) #mode of binom PDF used
  211. Xset key
  212. Xset nozeroaxis
  213. Xset xrange [xmin - 1 : xmax + 1]
  214. Xset yrange [0 : ymax]
  215. Xset xlabel "k ->"
  216. Xset ylabel "probability density ->"
  217. Xset xtics xmin, xinc, xmax
  218. Xset ytics 0, ymax / 10.0, ymax
  219. Xset format x "%2.0f"
  220. Xset format y "%3.2f"
  221. Xset sample 200
  222. Xset title "hypergeometric PDF using binomial approximation"
  223. Xset arrow from mu + 0.5, 0 to mu + 0.5, binom(mu) nohead
  224. Xset arrow from mu + 0.5, binom(mu + sigma) \
  225. X          to mu + 0.5 + sigma, binom(mu + sigma) nohead
  226. Xset label "mu" at mu + 1, ymax / 10
  227. Xset label "sigma" at mu + 1 + sigma, binom(mu + sigma)
  228. Xplot hypgeo(x), binom(x)
  229. Xpause -1 "Hit return to continue"
  230. Xset noarrow
  231. Xset nolabel
  232. X
  233. X# Hypergeometric PDF using normal approximation
  234. Xnn = 75; mm = 25; n = 10
  235. Xp = real(mm) / nn
  236. Xmu = n * p
  237. Xsigma = sqrt(real(nn - n) / (nn - 1.0) * n * p * (1.0 - p))
  238. Xxmin = floor(mu - 4.0 * sigma)
  239. Xxmin = xmin < 0 ? 0 : xmin
  240. Xxmax = ceil(mu + 4.0 * sigma)
  241. Xxinc = ceil((xmax - xmin) / 10)
  242. Xxinc = xinc > 1 ? xinc : 1
  243. Xymax = 1.1 * hypgeo(mu) #mode of binom PDF used
  244. Xset key
  245. Xset nozeroaxis
  246. Xset xrange [xmin - 1 : xmax + 1]
  247. Xset yrange [0 : ymax]
  248. Xset xlabel "k, x ->"
  249. Xset ylabel "probability density ->"
  250. Xset xtics xmin, xinc, xmax
  251. Xset ytics 0, ymax / 10.0, ymax
  252. Xset format x "%2.0f"
  253. Xset format y "%3.2f"
  254. Xset sample 200
  255. Xset title "hypergeometric PDF using normal approximation"
  256. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  257. Xset arrow from mu + 0.5, normal(mu + sigma) \
  258. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  259. Xset label "mu" at mu + 1, ymax / 10
  260. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  261. Xplot hypgeo(x), normal(x - 0.5)
  262. Xpause -1 "Hit return to continue"
  263. Xset noarrow
  264. Xset nolabel
  265. X
  266. X# Negative binomial PDF using gamma approximation
  267. Xr = 8; p = 0.6
  268. Xmu = r * (1.0 - p) / p
  269. Xsigma = sqrt(mu / p)
  270. Xlambda = p
  271. Xrho = r * (1.0 - p)
  272. Xxmin = int(mu - 4.0 * sigma)
  273. Xxmin = xmin < 0 ? 0 : xmin
  274. Xxmax = int(mu + 4.0 * sigma)
  275. Xxinc = ceil((xmax - xmin) / 10)
  276. Xxinc = xinc > 1 ? xinc : 1
  277. Xymax = 1.1 * g((rho - 1) / lambda) #mode of gamma PDF used
  278. Xset key
  279. Xset nozeroaxis
  280. Xset xrange [xmin - 1 : xmax + 1]
  281. Xset yrange [0 : ymax]
  282. Xset xlabel "k, x ->"
  283. Xset ylabel "probability density ->"
  284. Xset xtics xmin + 0.499, ceil((xmax - xmin)/ 10.0), xmax
  285. Xset ytics 0, ymax / 10.0, ymax
  286. Xset format x "%2.0f"
  287. Xset format y "%3.2f"
  288. Xset sample 200
  289. Xset title "negative binomial PDF using gamma approximation"
  290. Xset arrow from mu + 0.5, 0 to mu + 0.5, g(mu) nohead
  291. Xset arrow from mu + 0.5, g(mu + sigma) \
  292. X          to mu + 0.5 + sigma, g(mu + sigma) nohead
  293. Xset label "mu" at mu + 1, ymax / 10
  294. Xset label "sigma" at mu + 1 + sigma, g(mu + sigma)
  295. Xplot negbin(x), g(x - 0.5)
  296. Xpause -1 "Hit return to continue"
  297. Xset noarrow
  298. Xset nolabel
  299. X
  300. X# Negative binomial PDF using normal approximation
  301. Xr = 8; p = 0.4
  302. Xmu = r * (1.0 - p) / p
  303. Xsigma = sqrt(mu / p)
  304. Xxmin = floor(mu - 4.0 * sigma)
  305. Xxmin = xmin < 0 ? 0 : xmin
  306. Xxmax = ceil(mu + 4.0 * sigma)
  307. Xxinc = ceil((xmax - xmin) / 10)
  308. Xxinc = xinc > 1 ? xinc : 1
  309. Xymax = 1.1 * negbin(mu - 1/p) #mode of gamma PDF used
  310. Xset key
  311. Xset nozeroaxis
  312. Xset xrange [xmin - 1 : xmax + 1]
  313. Xset yrange [0 : ymax]
  314. Xset xlabel "k, x ->"
  315. Xset ylabel "probability density ->"
  316. Xset xtics xmin + 0.499, ceil((xmax - xmin)/ 10.0), xmax
  317. Xset ytics 0, ymax / 10.0, ymax
  318. Xset format x "%2.0f"
  319. Xset format y "%3.2f"
  320. Xset sample 200
  321. Xset title "negative binomial PDF using normal approximation"
  322. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  323. Xset arrow from mu + 0.5, normal(mu + sigma) \
  324. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  325. Xset label "mu" at mu + 1, ymax / 10
  326. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  327. Xplot negbin(x), normal(x - 0.5)
  328. Xpause -1 "Hit return to continue"
  329. Xset noarrow
  330. Xset nolabel
  331. X
  332. X# Normal PDF using logistic approximation
  333. Xmu = 1.0; sigma = 1.5
  334. Xa = mu
  335. Xlambda = pi / (sqrt(3.0) * sigma)
  336. Xxmin = mu - 4.0 * sigma
  337. Xxmax = mu + 4.0 * sigma
  338. Xymax = 1.1 * logistic(mu) #mode of logistic PDF used
  339. Xset key
  340. Xset nozeroaxis
  341. Xset xrange [xmin: xmax]
  342. Xset yrange [0 : ymax]
  343. Xset xlabel "x ->"
  344. Xset ylabel "probability density ->"
  345. Xset xtics xmin, (xmax - xmin)/ 10.0, xmax
  346. Xset ytics 0, ymax / 10.0, ymax
  347. Xset format x "%.1f"
  348. Xset format y "%.2f"
  349. Xset sample 200
  350. Xset title "normal PDF using logistic approximation"
  351. Xset arrow from mu,0 to mu, normal(mu) nohead
  352. Xset arrow from mu, normal(mu + sigma) \
  353. X          to mu + sigma, normal(mu + sigma) nohead
  354. Xset label "mu" at mu + 1, ymax / 10
  355. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  356. Xplot logistic(x), normal(x)
  357. Xpause -1 "Hit return to continue"
  358. Xset noarrow
  359. Xset nolabel
  360. X
  361. X# Poisson PDF using normal approximation
  362. Xmu = 5.0
  363. Xsigma = sqrt(mu)
  364. Xxmin = floor(mu - 4.0 * sigma)
  365. Xxmin = xmin < 0 ? 0 : xmin
  366. Xxmax = ceil(mu + 4.0 * sigma)
  367. Xxinc = ceil((xmax - xmin) / 10)
  368. Xxinc = xinc > 1 ? xinc : 1
  369. Xymax = 1.1 * poisson(mu) #mode of poisson PDF used
  370. Xset key
  371. Xset nozeroaxis
  372. Xset xrange [xmin - 1 : xmax + 1]
  373. Xset yrange [0 : ymax]
  374. Xset xlabel "k, x ->"
  375. Xset ylabel "probability density ->"
  376. Xset xtics xmin, xinc, xmax
  377. Xset ytics 0, ymax / 10.0, ymax
  378. Xset format x "%2.0f"
  379. Xset format y "%3.2f"
  380. Xset sample 200
  381. Xset title "poisson PDF using normal approximation"
  382. Xset arrow from mu + 0.5, 0 to mu + 0.5, normal(mu) nohead
  383. Xset arrow from mu + 0.5, normal(mu + sigma) \
  384. X          to mu + 0.5 + sigma, normal(mu + sigma) nohead
  385. Xset label "mu" at mu + 1, ymax / 10
  386. Xset label "sigma" at mu + 1 + sigma, normal(mu + sigma)
  387. Xplot poisson(x), normal(x - 0.5)
  388. Xset noarrow
  389. Xset nolabel
  390. X
  391. Xload "defaults.ini"
  392. END_OF_FILE
  393.   if test 10444 -ne `wc -c <'gnuplot/demo/prob2.dem'`; then
  394.     echo shar: \"'gnuplot/demo/prob2.dem'\" unpacked with wrong size!
  395.   fi
  396.   # end of 'gnuplot/demo/prob2.dem'
  397. fi
  398. if test -f 'gnuplot/docs/gpcard.tex' -a "${1}" != "-c" ; then 
  399.   echo shar: Will not clobber existing file \"'gnuplot/docs/gpcard.tex'\"
  400. else
  401.   echo shar: Extracting \"'gnuplot/docs/gpcard.tex'\" \(41221 characters\)
  402.   sed "s/^X//" >'gnuplot/docs/gpcard.tex' <<'END_OF_FILE'
  403. X% Quick Reference Card for GNUPLOT 1992
  404. X% Format stolen shamelessly from the GNU Emacs reference card
  405. X%**start of header
  406. X\special{landscape}
  407. X\newcount\columnsperpage
  408. X
  409. X% This file can be printed with 1, 2, or 3 columns per page (see below).
  410. X% Specify how many you want here.  Nothing else needs to be changed.
  411. X% For GNUPLOT refcard, entries are too wide for 3 columns.  Print
  412. X% 2 columns landscape
  413. X
  414. X\columnsperpage=2
  415. X
  416. X% Copyright (c) 1987 Free Software Foundation, Inc.
  417. X
  418. X% This file is part of GNU Emacs, but was adapted for the GNUPLOT
  419. X% reference card because it was so nicely set up.
  420. X
  421. X% This file is intended to be processed by plain TeX (TeX82).
  422. X%
  423. X% The final reference card has six columns, three on each side.
  424. X% This file can be used to produce it in any of three ways:
  425. X% 1 column per page
  426. X%    produces six separate pages, each of which needs to be reduced to 80%.
  427. X%    This gives the best resolution.
  428. X% 2 columns per page
  429. X%    produces three already-reduced pages.
  430. X%    You will still need to cut and paste.
  431. X% 3 columns per page
  432. X%    produces two pages which must be printed sideways to make a
  433. X%    ready-to-use 8.5 x 11 inch reference card.
  434. X%    For this you need a dvi device driver that can print sideways.
  435. X% Which mode to use is controlled by setting \columnsperpage above.
  436. X%
  437. X% Author of GNU Emacs Refcard:
  438. X%  Stephen Gildea
  439. X%  UUCP: mit-erl!gildea
  440. X%  Internet: gildea@erl.mit.edu
  441. X%
  442. X% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
  443. X% for their many good ideas.
  444. X%
  445. X% Person who ripped off the formatter:
  446. X%  Alex Woo
  447. X%  NASA Ames Research Center
  448. X%  Internet: woo@ames.arc.nasa.gov
  449. X%
  450. X% Modified on 9 Dec 1992 by:
  451. X%  Daniel S. Lewart
  452. X%  University of Illinois
  453. X%  Internet: d-lewart@uiuc.edu
  454. X
  455. X% make \bye not \outer so that the \def\bye in the \else clause below
  456. X% can be scanned without complaint.
  457. X\def\bye{\par\vfill\supereject\end}
  458. X
  459. X\def\copyrightnotice{
  460. X\vskip 1ex plus 2 fill\begingroup\small
  461. XLayout adapted from the \TeX\ source for Stephen Gildea's GNU Emacs
  462. XReference Card (version 1.8).
  463. X
  464. XPostScript is a registered trademark of Adobe Systems Incorporated.
  465. XGNU, Versatec, Imagen, Printronix, Canon, GraphOn, Visual, MicroVAX,
  466. XUIS, Tektronix, Unix, VAX, VMS, NeWS, SunView, and em4010 are all
  467. Xtrademarks of various companies.  We endorse none of them.
  468. X
  469. X\endgroup}
  470. X
  471. X\newdimen\intercolumnskip
  472. X\newbox\columna
  473. X\newbox\columnb
  474. X
  475. X\def\ncolumns{\the\columnsperpage}
  476. X
  477. X\message{[\ncolumns\space
  478. X  column\if 1\ncolumns\else s\fi\space per page]}
  479. X
  480. X\def\scaledmag#1{ scaled \magstep #1}
  481. X
  482. X% This multi-way format was designed by Stephen Gildea
  483. X% October 1986.
  484. X% modified for GNUPLOT refcard by Alex Woo
  485. X
  486. X\if 1\ncolumns
  487. X%  \hsize 4in
  488. X  \hsize 6in
  489. X  \vsize 10in
  490. X  \voffset -.7in
  491. X  \font\titlefont=\fontname\tenbf \scaledmag3
  492. X  \font\headingfont=\fontname\tenbf \scaledmag2
  493. X  \font\smallfont=\fontname\sevenrm
  494. X  \font\smallsy=\fontname\sevensy
  495. X
  496. X  \footline{\hss\folio}
  497. X  \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
  498. X\else
  499. X%  \hsize 3.2in
  500. X  \hsize 5in
  501. X  \vsize 7.95in
  502. X  \hoffset -.75in
  503. X  \voffset -.745in
  504. X  \font\titlefont=cmbx10 \scaledmag2
  505. X  \font\headingfont=cmbx10 \scaledmag1
  506. X  \font\smallfont=cmr6
  507. X  \font\smallsy=cmsy6
  508. X  \font\eightrm=cmr8
  509. X  \font\eightbf=cmbx8
  510. X  \font\eightit=cmti8
  511. X  \font\eighttt=cmtt8
  512. X  \font\eightsy=cmsy8
  513. X  \textfont0=\eightrm
  514. X  \textfont2=\eightsy
  515. X  \def\rm{\eightrm}
  516. X  \def\bf{\eightbf}
  517. X  \def\it{\eightit}
  518. X  \def\tt{\eighttt}
  519. X  \normalbaselineskip=.8\normalbaselineskip
  520. X  \normallineskip=.8\normallineskip
  521. X  \normallineskiplimit=.8\normallineskiplimit
  522. X  \normalbaselines\rm           %make definitions take effect
  523. X
  524. X  \if 2\ncolumns
  525. X    \let\maxcolumn=b
  526. X    \footline{\hss\rm\folio\hss}
  527. X    \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
  528. X  \else \if 3\ncolumns
  529. X    \let\maxcolumn=c
  530. X    \nopagenumbers
  531. X  \else
  532. X    \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
  533. X    \errmessage{Illegal number of columns per page}
  534. X  \fi\fi
  535. X
  536. X  \intercolumnskip=.46in
  537. X  \def\abc{a}
  538. X  \output={%
  539. X      % This next line is useful when designing the layout.
  540. X      %\immediate\write16{Column \folio\abc\space starts with \firstmark}
  541. X      \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
  542. X      \else\if a\abc
  543. X        \global\setbox\columna\columnbox \global\def\abc{b}
  544. X        %% in case we never use \columnb (two-column mode)
  545. X        \global\setbox\columnb\hbox to -\intercolumnskip{}
  546. X      \else
  547. X        \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
  548. X  \def\multicolumnformat{\shipout\vbox{\makeheadline
  549. X      \hbox{\box\columna\hskip\intercolumnskip
  550. X        \box\columnb\hskip\intercolumnskip\columnbox}
  551. X      \makefootline}\advancepageno}
  552. X  \def\columnbox{\leftline{\pagebody}}
  553. X
  554. X  \def\bye{\par\vfill\supereject
  555. X    \if a\abc \else\null\vfill\eject\fi
  556. X    \if a\abc \else\null\vfill\eject\fi
  557. X    \end}
  558. X\fi
  559. X
  560. X% we won't be using math mode much, so redefine some of the characters
  561. X% we might want to talk about
  562. X\catcode`\^=12
  563. X\catcode`\_=12
  564. X
  565. X\chardef\\=`\\
  566. X\chardef\{=`\{
  567. X\chardef\}=`\}
  568. X
  569. X\hyphenation{mini-buf-fer}
  570. X
  571. X\parindent 0pt
  572. X\parskip 1ex plus .5ex minus .5ex
  573. X
  574. X\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
  575. X
  576. X\outer\def\newcolumn{\vfill\eject}
  577. X
  578. X\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
  579. X
  580. X\outer\def\section#1{\par\filbreak
  581. X  \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
  582. X  \vskip 2ex plus 1ex minus 1.5ex}
  583. X
  584. X\newdimen\keyindent
  585. X
  586. X\def\beginindentedkeys{\keyindent=1em}
  587. X\def\endindentedkeys{\keyindent=0em}
  588. X\endindentedkeys
  589. X
  590. X\def\paralign{\vskip\parskip\halign}
  591. X
  592. X\def\<#1>{$\langle${\rm #1}$\rangle$}
  593. X
  594. X\def\kbd#1{{\tt#1}\null}        %\null so not an abbrev even if period follows
  595. X
  596. X\def\beginexample{\par\leavevmode\begingroup
  597. X  \obeylines\obeyspaces\parskip0pt\tt}
  598. X{\obeyspaces\global\let =\ }
  599. X\def\endexample{\endgroup}
  600. X
  601. X
  602. X\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
  603. X%  {\hsize=.75\hsize\rightskip=1em
  604. X  {\hsize=.5\hsize\rightskip=1em
  605. X  \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
  606. X
  607. X\newbox\metaxbox
  608. X\setbox\metaxbox\hbox{\kbd{M-x }}
  609. X\newdimen\metaxwidth
  610. X\metaxwidth=\wd\metaxbox
  611. X
  612. X\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
  613. X  {\hskip\keyindent\relax#1\hfil}%
  614. X  \hskip -\metaxwidth minus 1fil
  615. X  \kbd{#2}\hfil}}
  616. X
  617. X\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
  618. X  &\kbd{#3}\quad\cr}
  619. X
  620. X%**end of header
  621. X
  622. X
  623. X\title{GNUPLOT Quick Reference}
  624. X
  625. X\centerline{(Copyright(c) Alex Woo 1992 June 1)}
  626. X
  627. X\section{Starting GNUPLOT}
  628. X
  629. X\key{to enter GNUPLOT}{gnuplot}
  630. X\key{to enter batch GNUPLOT}{gnuplot macro_file}
  631. X\key{to pipe commands to GNUPLOT}{application | gnuplot}
  632. X
  633. Xsee below for  environment variables you might want to change
  634. Xbefore entering GNUPLOT.
  635. X
  636. X\section{Exiting GNUPLOT}
  637. X
  638. X\key{exit GNUPLOT}{quit}
  639. X
  640. XAll GNUPLOT commands can be abbreviated to the first few
  641. Xunique letters, usually three characters.  This reference uses
  642. Xthe complete name for clarity.
  643. X
  644. X\section{Getting Help}
  645. X
  646. X\key{introductory help} {help plot}
  647. X\key{help on a topic}{help <topic>}
  648. X\key{list of all help available}{help or ?}
  649. X\key{show current environment}{show all}
  650. X\section{Command-line Editing}
  651. X
  652. XThe UNIX, MS-DOS and VMS versions of GNUPLOT support command-line
  653. Xediting and a command history.  EMACS style editing is supported.
  654. X
  655. X\beginindentedkeys
  656. X
  657. XLine Editing:
  658. X
  659. X\key{move back a single character}{^ B}
  660. X\key{move forward a single character}{^ F}
  661. X\key{moves to the beginning of the line}{^ A}
  662. X\key{moves to the end of the line}{^ E}
  663. X\key{delete the previous character} {^ H and DEL }
  664. X\key{deletes the current character}  {^ D}
  665. X\key{deletes to the end of line}{^ K}
  666. X\key{redraws line in case it gets trashed}{ ^ L,^ R}
  667. X\key{deletes the entire line}{ ^ U}
  668. X\key{deletes the last word}{ ^ W}
  669. X\endindentedkeys
  670. X\beginindentedkeys
  671. X
  672. XHistory:
  673. X
  674. X\key{moves back through history}{ ^ P }
  675. X\key{moves forward through history}{ ^ N }
  676. X\endindentedkeys
  677. X
  678. XThe following arrow keys may be used on the MS-DOS version if READLINE is
  679. Xused.
  680. X
  681. X\beginindentedkeys
  682. XIBM PC Arrow Keys:
  683. X
  684. X\key{Left  Arrow}{same as ^ B}
  685. X\key{Right Arrow}{same as ^ F}
  686. X\key{Ctrl Left  Arrow}{same as ^ A}
  687. X\key{Ctrl Right Arrow}{same as ^ E}
  688. X\key{Up    Arrow}{same as ^ P}
  689. X\key{Down  Arrow}{same as ^ N}
  690. X\endindentedkeys
  691. X
  692. X
  693. X
  694. X\section{Graphics Devices}
  695. X
  696. XAll screen graphics devices are specified by names and options.
  697. XThis information can be read from a startup file (.gnuplot in UNIX).
  698. XIf  you change the graphics device, you must replot with the
  699. X\kbd{replot} command.
  700. X
  701. X\key{get a list of valid devices }{set terminal [options]}
  702. X
  703. X\beginindentedkeys
  704. X
  705. XGraphics Terminals:
  706. X
  707. X\key{AED 512 Terminal}                          {set term aed512}
  708. X\key{AED 767 Terminal}                          {set term aed767}
  709. X\key{Amiga}                                     {set term amiga}
  710. X\key{Adobe Illustrator 3.0 Format}              {set term aifm}
  711. X\key{Apollo graphics primitive, rescalable}     {set term apollo}
  712. X\key{Atari ST}                                  {set term atari}
  713. X\key{BBN Bitgraph Terminal}                     {set term bitgraph}
  714. X\key{SCO CGI Driver}                            {set term cgi}
  715. X\key{Apollo graphics primitive, fixed window}   {set term gpr}
  716. X\key{SGI GL windown}                            {set term iris4d [8 24]}
  717. X\key{MS-DOS Kermit Tek4010 term - color}        {set term kc_tek40xx}
  718. X\key{MS-DOS Kermit Tek4010 term - mono}         {set term km_tek40xx}
  719. X\key{NeXTstep window system}                    {set term next}
  720. X\key{REGIS graphics language}                   {set term regis}
  721. X\key{Selanar Tek Terminal}                      {set term selanar}
  722. X\key{SunView window system}                     {set term sun}
  723. X\key{Tektronix 4106, 4107, 4109 \& 420X }       {set term tek4OD10x}
  724. X\key{Tektronix 4010; most TEK emulators}        {set term tek40xx}
  725. X\key{VAX UIS window system}                     {set term VMS}
  726. X\key{VT-like tek40xx terminal emulator}         {set term vttek}
  727. X\key{UNIX plotting (not always supplied)}       {set term unixplot}
  728. X\key{AT\&T 3b1 or 7300 UNIXPC}                  {set term unixpc}
  729. X\key{X11 default display device}                {set term x11}
  730. X\key{X11 multicolor point default device}       {set term X11}
  731. X
  732. X\endindentedkeys
  733. X
  734. X\beginindentedkeys
  735. X
  736. XTurbo C PC Graphics Modes:
  737. X
  738. X\key{Hercules}{set term hercules}
  739. X\key{Color Graphics Adaptor}{set term cga}
  740. X\key{Monochrome CGA}{set term mcga}
  741. X\key{Extended Graphics Adaptor}{set term ega}
  742. X\key{VGA} {set term vga}
  743. X\key{Monochrome VGA} {set term vgamono}
  744. X\key{Super VGA - requires SVGA driver}{set term svga}
  745. X\key{AT\&T 6300 Micro}{set term att}
  746. X
  747. X\endindentedkeys
  748. X
  749. XMS Windows 3.x and OS/2 Presentation Manager are also supported.
  750. X
  751. X\beginindentedkeys
  752. X
  753. XHardcopy Devices:
  754. X
  755. X\key{Unknown - not a plotting device} {set term unknown}
  756. X\key{Dump ASCII table of X Y [Z] values}{set term table}
  757. X\key{printer or glass dumb terminal}                    {set term dumb}
  758. X\key{Roland DXY800A plotter}                            {set term dxy800a}
  759. X
  760. XDot Matrix Printers
  761. X
  762. X\key{Epson-style 60-dot per inch printers}              {set term epson_60dpi}
  763. X\key{Epson LX-800, Star NL-10 }{set term epson_lx800}
  764. X\key{NX-1000, PROPRINTER }{set term epson_lx800}
  765. X\key{NEC printer CP6, Epson LQ-800 }
  766. X                        {set term nec_cp6 [monochrome color draft]}
  767. X\key{Star Color Printer}                                {set term starc}
  768. X\key{Tandy DMP-130  60-dot per inch }   {set term tandy_60dpi}
  769. X\key{Vectrix 384 \& Tandy color printer}                {set term vx384}
  770. X
  771. XLaser Printers
  772. X
  773. X\key{Talaris EXCL language}{set term excl}
  774. X\key{Imagen laser printer}                              {set term imagen}
  775. X\key{LN03-Plus in EGM mode}                     {set term ln03}
  776. X\key{PostScript graphics language }
  777. X                {set term post [mode color `font' size]}
  778. X\key{CorelDraw EPS}
  779. X                {set term corel [mode color `font' size]}
  780. X\key{Prescribe - for the Kyocera Laser Printer} {set term prescribe}
  781. X\key{Kyocera Laser Printer with Courier font}           {set term kyo}
  782. X\key{QMS/QUIC Laser  (also Talaris 1200 )}{set term qms}
  783. X
  784. XMetafiles
  785. X
  786. X\key{AutoCAD DXF (120x80 default)}                      {set term dxf}
  787. X\key{FIG graphics language: SunView or X }{set term fig}
  788. X\key{FIG graphics language:  Large Graph}{set term bfig}
  789. X\key{SCO hardcopy CGI}{set term hcgi}
  790. X\key{Frame Maker MIF 3.0}
  791. X                {set term mif [pentype curvetype help]}
  792. X\key{Portable bitmap}                                   {set term pbm [fontsize color]}
  793. X\key{Uniplex Redwood Graphics Interface Protocol}{set term rgip}
  794. X\key{TGIF language}                             {set term tgif}
  795. X
  796. XHP Devices
  797. X
  798. X\key{HP2623A and maybe others}                  {set term hp2623A}
  799. X\key{HP2648 and HP2647}                         {set term hp2648}
  800. X\key{HP7580, \& probably other HPs (4 pens)}            {set term hp7580B}
  801. X\key{HP7475 \&  lots of others (6 pens)}        {set term hpgl}
  802. X\key{HP Laserjet series II \& clones}   {set term hpljii [75 100 150 300]}
  803. X\key{HP DeskJet 500} {set term hpdj [75 100 150 300]}
  804. X\key{HP PaintJet \& HP3630 }
  805. X                                {set term hppj [FNT5X9 FNT9X17 FNT13x25]}
  806. X\key{HP laserjet III ( HPGL plot vectors)}
  807. X                {set term pcl5 [mode font fontsize ]}
  808. X
  809. XTeX picture environments
  810. X
  811. X\key{LaTeX picture environment}                 {set term latex}
  812. X\key{EEPIC -- extended LaTeX picture }  {set term eepic}
  813. X\key{LaTeX picture  with emTeX specials}        {set term emtex}
  814. X\key{PSTricks macros for TeX or LaTeX}  {set term pstricks}
  815. X\key{TPIC specials for TeX or LaTeX}    {set term tpic}
  816. X\key{MetaFont font generation input}                    {set term mf}
  817. X
  818. X
  819. X\endindentedkeys
  820. X
  821. X\section{Files}
  822. X
  823. X\key{{\bf plot} a data file}{plot `fspec'}
  824. X\key{{\bf load} in a macro file}{load `fspec'}
  825. X\key{{\bf save} command buffer to a macro file}{save `fspec'}
  826. X\key{{\bf save settings} for later reuse}{save set `fpec'}
  827. X
  828. X\section{PLOT \& SPLOT commands}
  829. X
  830. X
  831. X{\bf plot} and {\bf splot} are the primary commands
  832. X{\bf plot} is used to plot 2-d
  833. Xfunctions and data, while {\bf splot} plots 3-d surfaces and data.
  834. X
  835. XSyntax:
  836. X
  837. X        plot $\{$ranges$\}$ $<$function$> \{$title$\} \{$style$\}$
  838. X                    $\{, <$function$> \{$title$\} \{$style$\}...\}$
  839. X
  840. X        splot $\{$ranges$\} <$function$> \{$title$\} \{$style$\}$
  841. X                    $\{, <$function$> \{$title$\} \{$style$\}...\}$
  842. X
  843. Xwhere $<$function$>$ is either a mathematical expression, the name of a
  844. Xdata file enclosed in quotes, or a pair ({\bf plot}) or triple ({\bf splot})
  845. Xof mathematical expressions in the case of parametric functions.
  846. XUser-defined functions and variables may also be defined here.
  847. XExamples will be given below.
  848. X
  849. X\section{Plotting Data}
  850. XDiscrete data contained in a file can displayed by specifying the
  851. Xname of the data file (enclosed in quotes) on the {\bf plot} or {\bf splot}
  852. Xcommand line. Data files should contain one data point per line.
  853. XLines beginning with \# (or ! on VMS) will be treated as comments
  854. Xand ignored. For {\bf plot}s, each data point represents an (x,y)
  855. Xpair. For {\bf splot}s, each point is an (x,y,z) triple. For {\bf plot}s with
  856. Xerror bars (see {\bf plot errorbars}), each data point is either
  857. X(x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
  858. Xline of a data file must be separated by blank space. This blank
  859. Xspace divides each line into columns.
  860. X
  861. XFor {\bf plot}s the x value may be omitted, and for {\bf splot}s the x
  862. Xand y values may be omitted. In either case the omitted values are
  863. Xassigned the current coordinate number. Coordinate numbers start at 0
  864. Xand are incremented for each data point read.
  865. X
  866. X\section{Surface Plotting}
  867. XImplicitly, there are two types of 3-d datafiles. If all the isolines
  868. Xare of the same length, the data is assumed to be a grid data, i.e.,
  869. Xthe data has a grid topology. Cross isolines in the other parametric
  870. Xdirection (the ith cross isoline passes thru the ith point of all the
  871. Xprovided isolines) will also be drawn for grid data. (Note contouring
  872. Xis available for grid data only.) If all the isolines are not of the
  873. Xsame length, no cross isolines will be drawn and contouring that data
  874. Xis impossible.
  875. X
  876. XFor splot if 3-d datafile and using format (see {\bf splot datafile using})
  877. Xspecify only z (height field), a non parametric mode must be specified.
  878. XIf, on the other hand, x, y, and z are all specified, a parametric
  879. Xmode should be selected (see {\bf set parametric}) since data is defining a
  880. Xparametric surface.
  881. X
  882. X\key{example of plotting a 3-d data}{set parametric;splot 'glass.dat'}
  883. X\key{example of plotting explicit}{set noparametric;splot 'datafile.dat'}
  884. X
  885. X\section{Using Pipes}
  886. X
  887. XOn some computer systems with a popen function (UNIX), the datafile
  888. Xcan be piped through a shell command by starting the file name
  889. Xwith a '$<$'.  For example:
  890. X
  891. X        pop(x) = 103*exp(x/10)
  892. X        plot "$<$ awk '$\{$ print \$1-1965 \$2 $\}$' population.dat", pop(x)
  893. X
  894. Xwould plot the same information as the first population example
  895. Xbut with years since 1965 as the x axis.
  896. X
  897. XSimilarly, output can be piped to another application, e.g.
  898. X
  899. X        set out "$|$lpr -Pmy\_laser\_printer"
  900. X
  901. X\section{Plot Data Using}
  902. XThe format of data within a file can be selected with the {\bf using}
  903. Xoption. An explicit scanf string can be used, or simpler column
  904. Xchoices can be made.
  905. X
  906. X\key{plot "datafile"}{ $\{$ using $\{ <$ycol$> |$}
  907. X\key{}{$<$xcol$>:<$ycol$> |$}
  908. X\key{}{$<$xcol$>:<$ycol$>:<$ydelta$> |$}
  909. X\key{}{$<$xcol$>:<$ycol$>:<$ylow$>:<$yhigh$> \}$}
  910. X\key{}{$\{$"<scanf string>"$\} \} ...$}
  911. X
  912. X\key{splot "datafile"}
  913. X{$\{$ using $\{ <$xcol$>:<$ycol$>:<$zcol$> \}$}
  914. X\key{}{$\{"<$scanf string$>"\} \} ...$}
  915. X
  916. X$<$xcol$>$, $<$ycol$>$, and $<$zcol$>$ explicitly select the columns to plot from
  917. Xa space or tab separated multicolumn data file. If only $<$ycol$>$ is
  918. Xselected for {\bf plot}, $<$xcol$>$ defaults to 1. If only $<$zcol$>$ is selected
  919. Xfor {\bf splot}, then only that column is read from the file. An $<$xcol$>$ of
  920. X0 forces $<$ycol$>$ to be plotted versus its coordinate number. $<$xcol$>$,
  921. X$<$ycol$>$, and $<$zcol$>$ can be entered as constants or expressions.
  922. X
  923. XIf errorbars (see also {\bf plot errorbars}) are used for {\bf plot}s,
  924. Xydelta (for example, a +/- error) should be provided as the third
  925. Xcolumn, or ylow and yhigh as third and fourth columns.  These columns
  926. Xmust follow the x and y columns.
  927. X
  928. XScanf strings override any $<$xcol$>$:$<$ycol$>$(:$<$zcol$>$) choices, except for
  929. Xordering of input, e.g.,
  930. X
  931. X\key{plot "datafile"}{ using 2:1 "\%f\%*f\%f"}
  932. X
  933. Xcauses the first column to be y and the third column to be x.
  934. X
  935. XIf the scanf string is omitted, the default is generated based on the
  936. X$<$xcol$>$:$<$ycol$>$(:$<$zcol$>$) choices. If the {\bf using} option is omitted, ''\%f\%f''
  937. Xis used for {\bf plot} (''\%f\%f\%f\%f'' for {\bf errorbar} {\bf plot}s) and ''\%f\%f\%f'' is
  938. Xused for {\bf splot}.
  939. X
  940. X\key{plot "MyData"} {using "\%*f\%f\%*20[^$\backslash$n]\%f" w lines}
  941. X
  942. XData are read from the file ``MyData'' using the format
  943. X''\%*f\%f\%*20[^$\backslash$n]\%f''. The meaning of this format is: ''\%*f'' ignore the
  944. Xfirst number, ''\%f'' then read in the second and assign to x,
  945. X''\%*20[^$\backslash$n]'' then ignore 20 non-newline characters, ''\%f'' then read in
  946. Xthe y value.
  947. X
  948. X\section{Plot With Errorbars}
  949. XError bars are supported for 2-d data file plots by reading one or
  950. Xtwo additional columns specifying ydelta or ylow and yhigh
  951. Xrespectively. No support exists for x error bars or any error bars
  952. Xfor {\bf splot}s.
  953. X
  954. XIn the default situation, GNUPLOT expects to see three or four
  955. Xnumbers on each line of the data file, either (x, y, ydelta) or
  956. X(x, y, ylow, yhigh). The x coordinate must be specified. The order
  957. Xof the numbers must be exactly as given above. Data files in this
  958. Xformat can easily be plotted with error bars:
  959. X
  960. X        plot "data.dat" with errorbars
  961. X
  962. XThe error bar is a vertical line plotted from (x, ylow) to (x,
  963. Xyhigh). If ydelta is specified instead of ylow and yhigh,
  964. Xylow=y-ydelta and yhigh=y+ydelta are derived. If there
  965. Xare only two numbers on the line, yhigh and ylow are both set to
  966. Xy. To get lines plotted between the data points, {\bf plot} the
  967. Xdata file twice, once with errorbars and once with lines.
  968. X
  969. XIf y autoscaling is on, the y range will be adjusted to fit the
  970. Xerror bars.
  971. X
  972. X\key{x,y,ylow \& yhigh from columns 1,2,3,4}{plot "data.dat" us 1:2:3:4 w errorbars}
  973. X\key{x from third, y from second, ydelta from 6}{plot "data.dat" using 3:2:6 with errorbars}
  974. X
  975. X\section{Plot Ranges}
  976. XThe optional range specifies the region of the plot that will be
  977. Xdisplayed.
  978. X
  979. XRanges may be provided on the {\bf plot} and {\bf splot} command line and
  980. Xaffect only that plot, or in the {\bf set xrange}, {\bf set yrange}, etc.,
  981. Xcommands, to change the default ranges for future plots.
  982. X
  983. X\key{[$\{<$dummy-var$> =\} \{<$xmin$> : <$xmax$>\}$]} { $\{$ [$\{<$ymin$> : <$ymax$>\}$] $\}$}
  984. X
  985. Xwhere $<$dummy-var$>$ is the independent variable (the defaults are x and
  986. Xy, but this may be changed with {\bf set dummy}) and the min and max
  987. Xterms can be constant expressions.
  988. X
  989. XBoth the min and max terms are optional. The ':' is also optional
  990. Xif neither a min nor a max term is specified. This allows '[ ]' to
  991. Xbe used as a null range specification.
  992. X
  993. XSpecifying a range in the {\bf plot} command line turns autoscaling for
  994. Xthat axis off for that plot. Using one of the {\bf set} range commands
  995. Xturns autoscaling off for that axis for future plots, unless changed
  996. Xlater. (See {\bf set autoscale}).
  997. X
  998. X\key{This uses the current ranges}{plot cos(x)}
  999. X\key{This sets the x range only}{plot [-10:30] sin(pi*x)/(pi*x)}
  1000. X\key{This sets both the x and y ranges}{plot [-pi:pi] [-3:3]  tan(x), 1/x}
  1001. X\key{sets only y range, \&} {plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)}
  1002. X\key{turns off autoscaling on both axes}{}
  1003. X\key{This sets xmax and ymin only}{plot [:200] [-pi:]  exp(sin(x))}
  1004. X\key{This sets the x, y, and z ranges}{splot [0:3] [1:4] [-1:1] x*y}
  1005. X
  1006. X\section{Plot With Style}
  1007. XPlots may be displayed in one of six styles: {\bf lines}, {\bf points},
  1008. X{\bf linespoints}, {\bf impulses}, {\bf dots}, {\bf steps},
  1009. Xor {\bf errorbars}. The {\bf lines} style
  1010. Xconnects adjacent points with lines. The {\bf points} style displays a
  1011. Xsmall symbol at each point. The {\bf linespoints} style does both
  1012. X{\bf lines} and {\bf points}. The {\bf impulses} style displays a vertical line
  1013. Xfrom the x axis (or from the grid base for {\bf splot}) to each point. The
  1014. X{\bf dots} style plots a tiny dot at each point; this is useful for
  1015. Xscatter plots with many points.
  1016. X
  1017. XThe {\bf errorbars} style is only relevant to 2-d data file plotting. It
  1018. Xis treated like {\bf points} for {\bf splot}s and function {\bf plot}s. For data
  1019. X{\bf plot}s, {\bf errorbars} is like {\bf points}, except that a vertical error
  1020. Xbar is also drawn: for each point (x,y), a line is drawn from
  1021. X(x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
  1022. Xbar. The ylow and yhigh values are read from the data file's columns,
  1023. Xas specified with the {\bf using} option to plot. See {\bf plot errorbars} for
  1024. Xmore information.
  1025. X
  1026. XDefault styles are chosen with the {\bf set function style} and
  1027. X{\bf set data style} commands.
  1028. X
  1029. XBy default, each function and data file will use a different
  1030. Xline type and point type, up to the maximum number of available
  1031. Xtypes. All terminal drivers support at least six different point
  1032. Xtypes, and re-use them, in order, if more than six are required.
  1033. XThe LaTeX driver supplies an additional six point types (all variants
  1034. Xof a circle), and thus will only repeat after twelve curves are
  1035. Xplotted with points.
  1036. X
  1037. XIf desired, the style and (optionally) the line type and point type
  1038. Xused for a curve can be specified.
  1039. X
  1040. X\key{with $<$style$>$}{$ \{<$linetype$> \{<$pointtype$>\}\}$}
  1041. X
  1042. Xwhere $<$style$>$ is either {\bf lines}, {\bf points}, {\bf linespoints}, {\bf impulses},
  1043. X{\bf dots}, {\bf steps}, or {\bf errorbars}.
  1044. XThe $<$linetype$>$ \& $<$pointtype$>$ are positive
  1045. Xinteger constants or expressions and specify the line type and point
  1046. Xtype to be used for the plot. Line type 1 is the first line type used
  1047. Xby default, line type 2 is the second line type used by default, etc.
  1048. X
  1049. X\key{plots sin(x) with impulses}{plot sin(x) with impulses}
  1050. X\key{plots x*y with points, x**2 + y**2 default}{splot x*y w points, x**2 + y**2}
  1051. X\key{plots tan(x) with default function style}
  1052. X        {plot [ ] [-2:5] tan(x)}
  1053. X\key{plots ``data.1'' with lines}{plot "data.1" with l}
  1054. X\key{plots ``leastsq.dat'' with impulses} {plot 'leastsq.dat' w i}
  1055. X\key{plots ``exper.dat'' with errorbars \& }
  1056. X{plot 'exper.dat' w l, 'exper.dat' w err}
  1057. X\key{ lines connecting points}{}
  1058. X
  1059. XHere 'exper.dat' should have three or four data columns.
  1060. X
  1061. X\key{plots x**2 + y**2 and x**2 - y**2 with the same line type}
  1062. X{splot x**2 + y**2 w l 1, x**2 - y**2 w l 1}
  1063. X\key{plots sin(x) and cos(x) with linespoints, using}
  1064. X    {plot sin(x) w linesp 1 3, \\}
  1065. X\key{ the same line type but different point types}{ cos(x) w linesp 1 4}
  1066. X\key{plots file ``data'' with points style 3}
  1067. X{plot "data" with points 1 3}
  1068. X
  1069. XNote that the line style must be specified when specifying the point
  1070. Xstyle, even when it is irrelevant. Here the line style is 1 and the
  1071. Xpoint style is 3, and the line style is irrelevant.
  1072. X
  1073. XSee {\bf set style} to change the default styles.
  1074. X
  1075. X\section{Plot Title}
  1076. X
  1077. XA title of each plot appears in the key. By default the title is
  1078. Xthe function or file name as it appears on the plot command line.
  1079. XThe title can be changed by using the {\bf title} option. This option
  1080. Xshould precede any {\bf with} option.
  1081. X
  1082. X\key{        title "$<$title$>$"}{}
  1083. X
  1084. Xwhere $<$title$>$ is the new title of the plot and must be enclosed in
  1085. Xquotes. The quotes will not be shown in the key.
  1086. X
  1087. X\key{plots y=x with the title 'x'} {plot x}
  1088. X\key{plots the ``glass.dat'' file}
  1089. X{splot "glass.dat" tit 'revolution surface'}
  1090. X\key{with the title 'revolution surface'}{}
  1091. X\key{plots x squared with title ``x^2'' and ``data.1''}
  1092. X    {plot x**2 t "x^2", \\}
  1093. X\key{ with title 'measured data'}{ "data.1" t 'measured data'}
  1094. X
  1095. X\section{Set-Show Commands}
  1096. X
  1097. X\beginindentedkeys
  1098. X\key{all commands below begin with set}{set}
  1099. X\key{set mapping of polar angles}{angles [degrees|radians]}
  1100. X\key{arrows from point to}{arrow [<tag>][from <sx>,<sy>,<sz>]}
  1101. X\key{}{ [to <ex>,<ey>,<ez>][nohead]}
  1102. X\key{force autoscaling of an axis}{autoscale [<axes>]}
  1103. X\key{enter/exit parametric mode} {[no]parametric}
  1104. X\key{display border}{[no]border}
  1105. X\key{clip points/line near boundaries}{[no]clip <clip-type>}
  1106. X\key{specify parameters for contour plots}{cntrparam
  1107. X[spline][points][order][levels]}
  1108. X\key{enable splot contour plots}{[no]contour [base|surface|both]}
  1109. X\key{default plotting style for data}{data style <style-choice>}
  1110. X\key{specify dummy variable}{dummy <dummy1>,<dummy2>...}
  1111. X\key{tic-mark label format specification}{format
  1112. X[<axes>]["format-string"]}
  1113. X\key{function plotting style}{function style <style-choice>}
  1114. X\key{draw a grid at tick marks}{[no]grid}
  1115. X\key{enables hiddenline removal}{[no]hidden3d}
  1116. X\key{specify number of isolines}{isosamples <expression>}
  1117. X\key{enables key of curves in plot}{key <x>,<y>,<z>}
  1118. X\key{logscaling of an axes (optionally giving base)}{logscale <axes> [<base>]}
  1119. X\key{mapping 3D coordinates}{mapping
  1120. X[cartesian|spherical|cylindrical]}
  1121. X\key{offsets from center of graph}{offsets
  1122. X<left>,<right>,<top>,<bottom>}
  1123. X\key{mapping 2D coordinates}{[no]polar}
  1124. X\key{set radial range}{rrange [<rmin>:<rmax>]}
  1125. X\key{set sampling rate of functions}{samples <expression>}
  1126. X\key{set scaling factors of plot}{size <xsize>,<ysize>}
  1127. X\key{control display of isolines of surface}{[no]surface}
  1128. X\key{control graphics device}{terminal <device>}
  1129. X\key{change direction of tics}{tics <direction>}
  1130. X\key{adjust relative height of vertical axis}{ticslevel <level>}
  1131. X\key{turn on time/date stamp}{[no]time}
  1132. X\key{set centered plot title}{title "title-text" <xoff>,<yoff>}
  1133. X\key{set parametric range}{trange [<tmin>:<tmax>]}
  1134. X\key{set surface parametric ranges}{urange or vrange}
  1135. X\key{sets the view point for {\bf splot}}{view
  1136. X<rot_x>,<rot_z>,<scale>,<scale_z>}
  1137. X\key{sets x-axis label}{xlabel "<label>" <xoff>,<yoff>}
  1138. X\key{set horizontal range}{xrange [<xmin>:<xmax>]}
  1139. X\key{change horizontal tics}{xtics <start>,<incr>,<end>,}
  1140. X\key{}{"<label>" <pos> }
  1141. X\key{draw x-axis}{[no]xzeroaxis}
  1142. X\key{sets y-axis label}{ylabel "<label>" <xoff>,<yoff>}
  1143. X\key{set vertical range}{yrange [<ymin>:<ymax>]}
  1144. X\key{change vertical tics}{ytics <start>,<incr>,<end>,}
  1145. X\key{}{"<label>" <pos> }
  1146. X\key{draw y-axis}{[no]yzeroaxis}
  1147. X\key{set default threshold for values near 0}{zero <expression>}
  1148. X\key{draw axes}{[no]zeroaxis}
  1149. X\key{sets z-axis label}{zlabel "<label>" <xoff>,<yoff>}
  1150. X\key{set vertical range}{zrange [<zmin>:<zmax>]}
  1151. X\key{change vertical tics}{ztics <start>,<incr>,<end>,}
  1152. X\key{}{"<label>" <pos> }
  1153. X\key{draw z-axis}{[no]zzeroaxis}
  1154. X\endindentedkeys
  1155. X
  1156. X\section{Contour Plots}
  1157. XEnable contour drawing for surfaces. This option is available for {\bf splot}
  1158. Xonly.
  1159. X
  1160. XSyntax:
  1161. X        set contour $\{$ base $|$ surface $|$ both $\}$
  1162. X        set nocontour
  1163. X
  1164. XIf no option is provided to {\bf set contour}, the default is {\bf base}.
  1165. XThe three options specify where to draw the contours: {\bf base} draws
  1166. Xthe contours on the grid base where the x/ytics are placed, {\bf surface}
  1167. Xdraws the contours on the surfaces themselves, and {\bf both} draws the
  1168. Xcontours on both the base and the surface.
  1169. X
  1170. XSee also {\bf set cntrparam} for the parameters that affect the drawing of
  1171. Xcontours.
  1172. X
  1173. X\section{Contour Parameters}
  1174. XSets the different parameters for the contouring plot (see also {\bf contour}).
  1175. X
  1176. X \key{set cntrparam}{ $\{ \{$ linear $|$ cubicspline $|$ bspline $\} |$}
  1177. X\key{}{points $<$n$>$ $|$ }
  1178. X\key{}{order $<$n$>$  $|$ }
  1179. X\key{}{levels \{ [ auto ] $<$n$>$ $|$ }
  1180. X\key{}{discrete $<$z1$>$ $<$z2$>$ ... $|$ }
  1181. X\key{}{incr $<$start$>$ $<$increment$>$ [ $<$n$>$ ] $\} \}$ }
  1182. X
  1183. X\key{5 automatic levels}{set cntrparam levels auto 5}
  1184. X\key{3 discrete levels at 10\%, 37\% and 90\%}
  1185. X        {set cntrp levels discrete .1 1/exp(1) .9}
  1186. X\key{5 incremental levels at 0, .1, .2, .3 and .4}
  1187. X        {set cntrparam levels incremental  0 .1 5 }
  1188. X\key{sets n = 10 retaining current setting of auto, incr., or discr.}
  1189. X        {set cntrparam levels 10 }
  1190. X\key{set start = 100 and increment = 50, retaining old n}
  1191. X        {set cntrparam levels incremental 100 50}
  1192. X
  1193. XThis command controls the way contours are plotted. $<$n$>$ should be an
  1194. Xintegral constant expression and $<$z1$>$, $<$z2$>$ any constant expressions.
  1195. XThe parameters are:
  1196. X
  1197. X{\bf linear}, {\bf cubicspline}, {\bf bspline} - Controls type of approximation or
  1198. Xinterpolation. If {\bf linear}, then the contours are drawn piecewise
  1199. Xlinear, as extracted from the surface directly. If {\bf cubicspline}, then
  1200. Xpiecewise linear contours are interpolated to form a somewhat smoother
  1201. Xcontours, but which may undulate. The third option is the uniform
  1202. X{\bf bspline}, which only approximates the piecewise linear data but is
  1203. Xguaranteed to be smoother.
  1204. X
  1205. X{\bf points} - Eventually all drawings are done with piecewise linear
  1206. Xstrokes.  This number controls the number of points used to
  1207. Xapproximate a curve.  Relevant for {\bf cubicspline} and {\bf bspline} modes
  1208. Xonly.
  1209. X
  1210. X{\bf order}  - Order of the bspline approximation to be used. The bigger this
  1211. Xorder is, the smoother the resulting contour.  (Of course, higher order
  1212. Xbspline curves will move further away from the original piecewise linear
  1213. Xdata.)  This option is relevant for {\bf bspline} mode only. Allowed values are
  1214. Xintegers in the range from 2 (linear) to 10.
  1215. X
  1216. X{\bf levels} - Number of contour levels, 'n'.  Selection of the levels is
  1217. Xcontrolled by 'auto' (default), 'discrete', and 'incremental'. For 'auto',
  1218. Xif the surface is bounded by zmin and zmax then contours will be
  1219. Xgenerated from zmin+dz to zmax-dz in steps of size dz, where
  1220. Xdz = (zmax - zmin) / (levels + 1).  For 'discrete', contours will be
  1221. Xgenerated at z = z1, z2 ... as specified.  The number of discrete levels
  1222. Xis limited to MAX\_DISCRETE\_LEVELS, defined in plot.h to be 30.  If
  1223. X'incremental', contours are generated at $<$n$>$ values of z beginning at
  1224. X$<$start$>$ and increasing by $<$increment$>$.
  1225. X
  1226. X\section{Specifying Labels}
  1227. XArbitrary labels can be placed on the plot using the {\bf set label}
  1228. Xcommand.  If the z coordinate is given on a {\bf plot} it is ignored; if
  1229. Xit is missing on a {\bf splot} it is assumed to be 0.
  1230. X
  1231. X\key{set label $\{<$tag$>\} \{"<$label_text$>"\}$}
  1232. X{$\{$at $<$x$>,<$y$>\{,<$z$>\}\}$}
  1233. X\key{}{$\{<$justification$>\}$}
  1234. X\key{set nolabel $\{<$tag$>\}$}{}
  1235. X\key{show label}{}
  1236. X
  1237. XThe text defaults to '''', and the position to 0,0,0.  The $<$x$>$, $<$y$>$, and
  1238. X$<$z$>$ values are in the graph's coordinate system.  The tag is an
  1239. Xinteger that is used to identify the label. If no $<$tag$>$ is given, the
  1240. Xlowest unused tag value is assigned automatically. The tag can be used
  1241. Xto delete or change a specific label. To change any attribute of an
  1242. Xexisting label, use the {\bf set label} command with the appropriate tag,
  1243. Xand specify the parts of the label to be changed.
  1244. X
  1245. XBy default, the text is placed flush left against the point x,y,z.
  1246. XTo adjust the way the label is positioned with respect to the point
  1247. Xx,y,z, add the parameter $<$justification$>$, which may be {\bf left}, {\bf right}
  1248. Xor {\bf center}, indicating that the point is to be at the left, right or
  1249. Xcenter of the text. Labels outside the plotted boundaries are
  1250. Xpermitted but may interfere with axes labels or other text.
  1251. X
  1252. X\key{label at (1,2) to ``y=x'' }{set label "y=x" at 1,2}
  1253. X\key{label ``y=x^2'' w right of the text at (2,3,4), }
  1254. X{set label 3 "y=x^2" at 2,3,4 right}
  1255. X\key{\& tag the label number 3 }{}
  1256. X\key{change preceding label to center justification}{set label 3 center}
  1257. X\key{delete label number 2 }{set nolabel 2}
  1258. X\key{delete all labels}{set nolabel}
  1259. X\key{show all labels (in tag order)}{show label}
  1260. X
  1261. X(The EEPIC, Imagen, LaTeX, and TPIC drivers allow $\backslash$$\backslash$
  1262. Xin a string to specify a newline.)
  1263. X
  1264. X\section{Miscellaneous Commands}
  1265. X
  1266. XFor further information on these commands, print out a copy
  1267. Xof the GNUPLOT manual.
  1268. X
  1269. X\key{change working directory}{cd}
  1270. X\key{erase current screen or device}{clear}
  1271. X\key{exit GNUPLOT}{exit or quit or EOF}
  1272. X\key{display text and wait}{pause <time> ["<string>"]}
  1273. X\key{print the value of $<$expression$>$}{print <expression>}
  1274. X\key{print working directory}{pwd}
  1275. X\key{repeat last {\bf plot} or {\bf splot}}{replot}
  1276. X\key{spawn an interactive shell}{! (UNIX) or \$ (VMS)}
  1277. X
  1278. X\section{Environment Variables}
  1279. X
  1280. XA number of shell environment variables are understood by GNUPLOT.
  1281. XNone of these are required, but may be useful.
  1282. X
  1283. XIf GNUTERM is defined, it is used as the name of the terminal type to
  1284. Xbe used. This overrides any terminal type sensed by GNUPLOT on start
  1285. Xup, but is itself overridden by the .gnuplot (or equivalent) start-up
  1286. Xfile (see {\bf start-up}), and of course by later explicit changes.
  1287. X
  1288. XOn Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
  1289. Xof the HELP file (gnuplot.gih).
  1290. X
  1291. XOn VMS, the symbol GNUPLOT\$HELP should be defined as the name of
  1292. Xthe help library for GNUPLOT.
  1293. X
  1294. XOn Unix, HOME is used as the name of a directory to search for
  1295. Xa .gnuplot file if none is found in the current directory.
  1296. XOn AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS\$LOGIN: is used.
  1297. XSee help start-up.
  1298. X
  1299. XOn Unix, PAGER is used as an output filter for help messages.
  1300. X
  1301. XOn Unix and AmigaDOS, SHELL is used for the {\bf shell} command. On MS-DOS,
  1302. XCOMSPEC is used for the {\bf shell} command.
  1303. X
  1304. XOn AmigaDOS, GNUFONT is used for the screen font.  For example:
  1305. X``setenv GNUFONT sapphire/14''.
  1306. X
  1307. XOn MS-DOS, if the BGI interface is used, the variable {\bf BGI} is used to point
  1308. Xto the full path to the BGI drivers directory. Furthermore SVGA is used to
  1309. Xname the Super VGA BGI driver in 800x600 res., and its mode of operation
  1310. Xas 'Name.Mode'.
  1311. XFor example, if the Super VGA driver is C:$\backslash$TC$\backslash$BGI$\backslash$SVGADRV.BGI and mode 3 is
  1312. Xused for 800x600 res., then: 'set BGI=C:$\backslash$TC$\backslash$BGI' and 'set SVGA=SVGADRV.3'.
  1313. X
  1314. X
  1315. X\section{Expressions}
  1316. XIn general, any mathematical expression accepted by C, FORTRAN,
  1317. XPascal, or BASIC is valid. The precedence of these operators is
  1318. Xdetermined by the specifications of the C programming language.
  1319. XWhite space (spaces and tabs) is ignored inside expressions.
  1320. X
  1321. XComplex constants may be expressed as $\{<$real$>,<$imag$>\}$, where
  1322. X$<$real$>$ and $<$imag$>$ must be numerical constants.  For example,
  1323. X$\{3,2\}$ represents 3 + 2{\bf i} and $\{0,1\}$ represents {\bf i}
  1324. Xitself.  The curly braces are explicitly required here.
  1325. X\section{Functions}
  1326. XThe functions in GNUPLOT are the same as the corresponding functions
  1327. Xin the Unix math library, except that all functions accept integer,
  1328. Xreal, and complex arguments, unless otherwise noted. The {\bf sgn}
  1329. Xfunction is also supported, as in BASIC.
  1330. X
  1331. X%\begin{center}
  1332. X%\begin{tabular}{|ccl|} \hline
  1333. X\settabs 5\columns
  1334. X\+Function & Arguments & Returns \cr
  1335. X\hrule%\hline
  1336. X\+ abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \cr
  1337. X\+ abs(x) & complex &  length of {\tt x}, $\sqrt{{\hbox{real}(x)^{2} +
  1338. X\hbox{imag}(x)^{2}}}$ \cr
  1339. X\+ acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \cr
  1340. X\+ arg(x) & complex & the phase of $x$ in radians\cr
  1341. X\+ asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \cr
  1342. X\+ atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \cr
  1343. X\+ besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \cr
  1344. X\+ besj1(x) & radians & $j_{1}$ Bessel function of $x$ \cr
  1345. X\+ besy0(x) & radians & $y_{0}$ Bessel function of $x$ \cr
  1346. X\+ besy1(x) & radians & $y_{1}$ Bessel function of $x$ \cr
  1347. X\+ ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
  1348. X(real part) \cr
  1349. X\+ cos(x) & radians & $\cos x$, cosine of $x$ \cr
  1350. X\+ cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \cr
  1351. X\+ erf(x) & any & $\hbox{Erf}(\hbox{real}(x))$,  error function of real($x$) \cr
  1352. X\+ erfc(x) & any & $\hbox{Erfc}(\hbox{real}(x))$,  1.0 - error function of real($x$) \cr
  1353. X\+ exp(x) & any & $e^{x}$,  exponential function of $x$ \cr
  1354. X\+ floor(x) & any & $\lfloor x \rfloor$,  largest integer not greater
  1355. Xthan $x$ (real part) \cr
  1356. X\+ gamma(x) & any & $\hbox{Gamma}(\hbox{real}(x))$,  gamma function of real($x$) \cr
  1357. X\+ ibeta(p,q,x) & any & $\hbox{Ibeta}(\hbox{real}(p,q,x))$,  ibeta function of real($p$,$q$,$x$) \cr
  1358. X\+ igamma(a,x) & any & $\hbox{Igamma}(\hbox{real}(a,x))$,  igamma function of real($a$,$x$) \cr
  1359. X\+ imag(x) & complex &  imaginary part of $x$ as a real number \cr
  1360. X\+ int(x) & real &  integer part of $x$, truncated toward zero \cr
  1361. X\+ lgamma(x) & any & $\hbox{Lgamma}(\hbox{real}(x))$,  lgamma function of real($x$) \cr
  1362. X\+ log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \cr
  1363. X\+ log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \cr
  1364. X\+ rand(x) & any & $\hbox{Rand}(\hbox{real}(x))$,  pseudo random number generator \cr
  1365. X\+ real(x) & any &  real part of $x$ \cr
  1366. X\+ sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \cr
  1367. X\+ sin(x) & radians & $\sin x$, sine of $x$ \cr
  1368. X\+ sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \cr
  1369. X\+ sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \cr
  1370. X\+ tan(x) & radians & $\tan x$,  tangent of $x$ \cr
  1371. X\+ tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\cr
  1372. X\hrule % \hline
  1373. X%\end{tabular}
  1374. X%\end{center}
  1375. X\section{Operators}
  1376. XThe operators in GNUPLOT are the same as the corresponding operators
  1377. Xin the C programming language, except that all operators accept
  1378. Xinteger, real, and complex arguments, unless otherwise noted.
  1379. XThe ** operator (exponentiation) is supported, as in FORTRAN.
  1380. X
  1381. XParentheses may be used to change order of evaluation.
  1382. X
  1383. X
  1384. X
  1385. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1386. X\bye
  1387. X\subsubsection{Binary}
  1388. XThe following is a list of all the binary operators and their
  1389. Xusages:
  1390. X
  1391. X
  1392. X\begin{center}
  1393. X\begin{tabular}{|ccl|} \hline
  1394. X\multicolumn{3}{|c|}{Binary Operators} \\
  1395. XSymbol & Example & Explanation \\ \hline
  1396. X\verb~**~ & \verb~a**b~ & exponentiation\\
  1397. X\verb~*~ & \verb~a*b~ & multiplication\\
  1398. X\verb~/~ & \verb~a/b~ & division\\
  1399. X\verb~%~ & \verb~a%b~ & * modulo\\
  1400. X\verb~+~ & \verb~a+b~ & addition\\
  1401. X\verb~-~ & \verb~a-b~ & subtraction\\
  1402. X\verb~==~ & \verb~a==b~ & equality\\
  1403. X\verb~!=~ & \verb~a!=b~ & inequality\\
  1404. X\verb~&~ & \verb~a&b~ & * bitwise AND\\
  1405. X\verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
  1406. X\verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
  1407. X\verb~&&~ & \verb~a&&b~ & * logical AND\\
  1408. X\verb~||~ & \verb~a||b~ & * logical OR\\
  1409. X\verb~?:~ & \verb~a?b:c~ & * ternary operation\\
  1410. X\hline
  1411. X\end{tabular}
  1412. X\end{center}
  1413. X(*) Starred explanations indicate that the operator requires
  1414. Xinteger arguments.
  1415. X
  1416. XLogical AND (\&\&) and OR ($|$$|$) short-circuit the way they do in C.
  1417. XThat is, the second \&\& operand is not evaluated if the first is
  1418. Xfalse; the second $|$$|$ operand is not evaluated if the first is true.
  1419. X
  1420. XThe ternary operator evaluates its first argument (a). If it is
  1421. Xtrue (non-zero) the second argument (b) is evaluated and returned,
  1422. Xotherwise the third argument (c) is evaluated and returned.
  1423. X\subsubsection{Unary}
  1424. XThe following is a list of all the unary operators and their
  1425. Xusages:
  1426. X
  1427. X
  1428. X\begin{center}
  1429. X\begin{tabular}{|ccl|} \hline
  1430. X\multicolumn{3}{|c|}{Unary Operators}\\
  1431. XSymbol & Example & Explanation \\ \hline
  1432. X\verb@-@ & \verb@-a@ & unary minus \\
  1433. X\verb@~@ & \verb@~a@ & * one's complement \\
  1434. X\verb@!@ & \verb@!a@ & * logical negation \\
  1435. X\verb@!@ & \verb@a!@ & * factorial \\
  1436. X\hline
  1437. X\end{tabular}
  1438. X\end{center}
  1439. X(*) Starred explanations indicate that the operator requires an
  1440. Xinteger argument.
  1441. X
  1442. XThe factorial operator returns a real number to allow a greater range.
  1443. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
  1444. END_OF_FILE
  1445.   if test 41221 -ne `wc -c <'gnuplot/docs/gpcard.tex'`; then
  1446.     echo shar: \"'gnuplot/docs/gpcard.tex'\" unpacked with wrong size!
  1447.   fi
  1448.   # end of 'gnuplot/docs/gpcard.tex'
  1449. fi
  1450. if test -f 'gnuplot/term/pc.trm' -a "${1}" != "-c" ; then 
  1451.   echo shar: Will not clobber existing file \"'gnuplot/term/pc.trm'\"
  1452. else
  1453.   echo shar: Extracting \"'gnuplot/term/pc.trm'\" \(25354 characters\)
  1454.   sed "s/^X//" >'gnuplot/term/pc.trm' <<'END_OF_FILE'
  1455. X/*
  1456. X * $Id: pc.trm 3.38.2.42 1993/01/07 17:23:59 woo Exp woo $
  1457. X *
  1458. X */
  1459. X
  1460. X/* GNUPLOT - pc.trm */
  1461. X/*
  1462. X * Copyright (C) 1990 - 1993
  1463. X *
  1464. X * Permission to use, copy, and distribute this software and its
  1465. X * documentation for any purpose with or without fee is hereby granted, 
  1466. X * provided that the above copyright notice appear in all copies and 
  1467. X * that both that copyright notice and this permission notice appear 
  1468. X * in supporting documentation.
  1469. X *
  1470. X * Permission to modify the software is granted, but not the right to
  1471. X * distribute the modified code.  Modifications are to be distributed 
  1472. X * as patches to released version.
  1473. X *
  1474. X * This software  is provided "as is" without express or implied warranty.
  1475. X *
  1476. X * This file is included by ../term.c.
  1477. X *
  1478. X * This terminal driver supports:
  1479. X *  Under Microsoft C
  1480. X *      cga, egabios, egalib, vgabios, hercules, corona325, att
  1481. X *  Under Turboc C
  1482. X *      egalib, vgalib, vgamono, svga, mcga, cga, hercules, att
  1483. X *
  1484. X * AUTHORS
  1485. X *  Colin Kelley, Thomas Williams, William Wilson, Russell Lang
  1486. X *
  1487. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  1488. X *
  1489. X */
  1490. X
  1491. X#ifdef __TURBOC__
  1492. X#include <graphics.h>
  1493. X#include <conio.h>
  1494. X#include <dos.h>
  1495. X  int g_driver, g_mode, g_error;
  1496. X  char far *path;
  1497. X  char *pathp, path_s[128];
  1498. X
  1499. X/* instead of string.h */
  1500. Xextern char *strrchr();
  1501. X
  1502. Xget_path()
  1503. X{
  1504. X   path=(char far *) getenv("BGI");
  1505. X   if (path==NULL) {
  1506. X      (void) strcpy(path_s,_argv[0]);
  1507. X      pathp=strrchr(path_s,'\\');
  1508. X      *pathp=0x00;
  1509. X      path=path_s;
  1510. X   }
  1511. X}
  1512. X
  1513. Xstatic struct text_info tinfo;       /* So we can restore starting text mode. */
  1514. X#endif
  1515. X
  1516. X
  1517. Xstatic char near buf[80];    /* kludge since EGA.LIB is compiled SMALL */
  1518. X
  1519. Xstatic int pattern[] = {0xffff, 0x0f0f, 0xffff, 0xaaaa, 0x3333, 0x3f3f, 0x0f0f};
  1520. X
  1521. Xstatic int graphics_on = FALSE;
  1522. Xint startx, starty;
  1523. X
  1524. Xint pc_angle;
  1525. X#define PC_VCHAR FNT5X9_VCHAR
  1526. X#define PC_HCHAR FNT5X9_HCHAR
  1527. X
  1528. Xpause()        /* press any key to continue... */
  1529. X{
  1530. X    (void) getch();
  1531. X}
  1532. X
  1533. X
  1534. XPC_text()
  1535. X{
  1536. X    if (graphics_on) {
  1537. X        graphics_on = FALSE;
  1538. X        pause();
  1539. X    }
  1540. X#ifdef __TURBOC__
  1541. X    restorecrtmode();
  1542. X        textmode(tinfo.currmode);
  1543. X    clrscr();
  1544. X#else
  1545. X    Vmode(3);
  1546. X#endif
  1547. X}
  1548. X
  1549. XPC_reset()
  1550. X{
  1551. X#ifdef __TURBOC__
  1552. X    closegraph();
  1553. X        textmode(tinfo.currmode);
  1554. X    clrscr();
  1555. X#endif
  1556. X}
  1557. X
  1558. X
  1559. X#ifndef __TURBOC__
  1560. X
  1561. XPC_putc(x,y,c,angle,line_func)
  1562. Xunsigned int x,y;
  1563. Xchar c;
  1564. Xint angle;
  1565. XFUNC_PTR line_func;
  1566. X{
  1567. Xint i,j,k;
  1568. Xunsigned int pixelon;
  1569. X    i = (int)(c) - 32;
  1570. X    for (j=0; j<FNT5X9_VBITS; j++) {
  1571. X        for (k=0; k<FNT5X9_HBITS; k++) {
  1572. X            pixelon = (((unsigned int)(fnt5x9[i][j])) >> k & 1);
  1573. X            if (pixelon) {
  1574. X                switch(angle) {
  1575. X                    case 0 : (*line_func)(x+k+1,y-j,x+k+1,y-j);
  1576. X                            break;
  1577. X                    case 1 : (*line_func)(x-j,y-k-1,x-j,y-k-1);
  1578. X                            break;
  1579. X                }
  1580. X            }
  1581. X        }
  1582. X    }
  1583. X}
  1584. X
  1585. X
  1586. Xint PC_text_angle(ang)
  1587. Xint ang;
  1588. X{
  1589. X    pc_angle=ang;
  1590. X    return TRUE;
  1591. X}
  1592. X
  1593. X
  1594. X#define CGA_XMAX 640
  1595. X#define CGA_YMAX 200
  1596. X
  1597. X#define CGA_XLAST (CGA_XMAX - 1)
  1598. X#define CGA_YLAST (CGA_YMAX - 1)
  1599. X
  1600. X#define CGA_VCHAR PC_VCHAR
  1601. X#define CGA_HCHAR PC_HCHAR
  1602. X#define CGA_VTIC 4
  1603. X#define CGA_HTIC 6
  1604. X
  1605. Xint line_cga;
  1606. X
  1607. XCGA_init()
  1608. X{
  1609. X    PC_color(1);        /* monochrome */
  1610. X}
  1611. X
  1612. XCGA_graphics()
  1613. X{
  1614. X    graphics_on = TRUE;
  1615. X    Vmode(6);
  1616. X}
  1617. X
  1618. X#define CGA_text PC_text
  1619. X
  1620. XCGA_linetype(linetype)
  1621. X{
  1622. X    if (linetype >= 5)
  1623. X        linetype %= 5;
  1624. X    line_cga=linetype;
  1625. X    PC_mask(pattern[linetype+2]);
  1626. X}
  1627. X
  1628. XCGA_move(x,y)
  1629. X{
  1630. X    startx = x;
  1631. X    starty = y;
  1632. X}
  1633. X
  1634. X
  1635. XCGA_vector(x,y)
  1636. X{
  1637. X    PC_line(startx,CGA_YLAST-starty,x,CGA_YLAST-y);
  1638. X    startx = x;
  1639. X    starty = y;
  1640. X}
  1641. X
  1642. X
  1643. XCGA_put_text(x,y,str)
  1644. Xunsigned int x, y;
  1645. Xchar *str;
  1646. X{
  1647. Xint i;
  1648. Xint line;
  1649. X    line= line_cga;     /* disable the dotted lines temporarily */
  1650. X    PC_mask(pattern[0]);
  1651. X    switch(pc_angle) {
  1652. X        case 0 : y -= CGA_VCHAR/2;
  1653. X                break;
  1654. X        case 1 : x += CGA_VCHAR/2;
  1655. X                break;
  1656. X    }
  1657. X    for (i=0;str[i];i++) {
  1658. X        PC_putc(x,CGA_YLAST-y,str[i],pc_angle,PC_line);
  1659. X        switch(pc_angle) {
  1660. X            case 0 : x+=CGA_HCHAR ;
  1661. X                    break;
  1662. X            case 1 : y+=CGA_HCHAR ;
  1663. X                    break;
  1664. X        }
  1665. X    }
  1666. X    PC_mask(pattern[line]);  /* enable dotted lines */
  1667. X}
  1668. X
  1669. X
  1670. X#define CGA_text_angle PC_text_angle
  1671. X
  1672. X#define CGA_reset PC_reset
  1673. X
  1674. X
  1675. X#define EGA_XMAX 640
  1676. X#define EGA_YMAX 350
  1677. X
  1678. X#define EGA_XLAST (EGA_XMAX - 1)
  1679. X#define EGA_YLAST (EGA_YMAX - 1)
  1680. X
  1681. X#define EGA_VCHAR PC_VCHAR
  1682. X#define EGA_HCHAR PC_HCHAR
  1683. X#define EGA_VTIC 4
  1684. X#define EGA_HTIC 5
  1685. X
  1686. Xstatic int ega64color[] =  {1,1,5,4,3,5,4,3, 5, 4, 3, 5, 4, 3,5};
  1687. Xstatic int ega256color[] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};
  1688. X
  1689. Xstatic int *egacolor;
  1690. X
  1691. X
  1692. XEGA_init()
  1693. X{
  1694. X    PC_mask(0xffff);
  1695. X    egacolor = ega256color;        /* should be smarter */
  1696. X}
  1697. X
  1698. XEGA_graphics()
  1699. X{
  1700. X    graphics_on = TRUE;
  1701. X    Vmode(16);
  1702. X}
  1703. X
  1704. X#define EGA_text PC_text
  1705. X
  1706. XEGA_linetype(linetype)
  1707. X{
  1708. X    if (linetype >= 13)
  1709. X        linetype %= 13;
  1710. X    PC_color(egacolor[linetype+2]);
  1711. X}
  1712. X
  1713. XEGA_move(x,y)
  1714. X{
  1715. X    startx = x;
  1716. X    starty = y;
  1717. X}
  1718. X
  1719. XEGA_vector(x,y)
  1720. X{
  1721. X    PC_line(startx,EGA_YLAST-starty,x,EGA_YLAST-y);
  1722. X    startx = x;
  1723. X    starty = y;
  1724. X}
  1725. X
  1726. X
  1727. XEGA_put_text(x,y,str)
  1728. Xunsigned int x, y;
  1729. Xchar *str;
  1730. X{
  1731. Xint i;
  1732. X    switch(pc_angle) {
  1733. X        case 0 : y -= EGA_VCHAR/2;
  1734. X                break;
  1735. X        case 1 : x += EGA_VCHAR/2;
  1736. X                break;
  1737. X    }
  1738. X    for (i=0;str[i];i++) {
  1739. X        PC_putc(x,EGA_YLAST-y,str[i],pc_angle,PC_line);
  1740. X        switch(pc_angle) {
  1741. X            case 0 : x+=EGA_HCHAR ;
  1742. X                    break;
  1743. X            case 1 : y+=EGA_HCHAR ;
  1744. X                    break;
  1745. X        }
  1746. X    }
  1747. X}
  1748. X
  1749. X
  1750. X#define EGA_text_angle PC_text_angle
  1751. X
  1752. X#define EGA_reset PC_reset
  1753. X
  1754. X
  1755. X
  1756. X/* The following VGA routines are hacked from the above EGA routines
  1757. X   They worked on two VGA cards.
  1758. X   Russell Lang, eln272v@monu1.cc.monash.oz */
  1759. X#define VGA_XMAX 640
  1760. X#define VGA_YMAX 480
  1761. X
  1762. X#define VGA_XLAST (VGA_XMAX - 1)
  1763. X#define VGA_YLAST (VGA_YMAX - 1)
  1764. X
  1765. X#define VGA_VCHAR PC_VCHAR
  1766. X#define VGA_HCHAR PC_HCHAR
  1767. X#define VGA_VTIC 5
  1768. X#define VGA_HTIC 5
  1769. X
  1770. Xstatic int vga256color[] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};
  1771. X
  1772. Xstatic int *vgacolor;
  1773. X
  1774. X
  1775. XVGA_init()
  1776. X{
  1777. X    PC_mask(0xffff);
  1778. X    vgacolor = vga256color;        /* should be smarter */
  1779. X}
  1780. X
  1781. XVGA_graphics()
  1782. X{
  1783. X    graphics_on = TRUE;
  1784. X    Vmode(18);
  1785. X}
  1786. X
  1787. X#define VGA_text PC_text
  1788. X
  1789. XVGA_linetype(linetype)
  1790. X{
  1791. X    if (linetype >= 13)
  1792. X        linetype %= 13;
  1793. X    PC_color(vgacolor[linetype+2]);
  1794. X}
  1795. X
  1796. XVGA_move(x,y)
  1797. X{
  1798. X    startx = x;
  1799. X    starty = y;
  1800. X}
  1801. X
  1802. XVGA_vector(x,y)
  1803. X{
  1804. X    PC_line(startx,VGA_YLAST-starty,x,VGA_YLAST-y);
  1805. X    startx = x;
  1806. X    starty = y;
  1807. X}
  1808. X
  1809. X
  1810. XVGA_put_text(x,y,str)
  1811. Xunsigned int x, y;
  1812. Xchar *str;
  1813. X{
  1814. Xint i;
  1815. X    switch(pc_angle) {
  1816. X        case 0 : y -= VGA_VCHAR/2;
  1817. X                break;
  1818. X        case 1 : x += VGA_VCHAR/2;
  1819. X                break;
  1820. X    }
  1821. X    for (i=0;str[i];i++) {
  1822. X        PC_putc(x,VGA_YLAST-y,str[i],pc_angle,PC_line);
  1823. X        switch(pc_angle) {
  1824. X            case 0 : x+=VGA_HCHAR ;
  1825. X                    break;
  1826. X            case 1 : y+=VGA_HCHAR ;
  1827. X                    break;
  1828. X        }
  1829. X    }
  1830. X}
  1831. X
  1832. X
  1833. X#define VGA_text_angle PC_text_angle
  1834. X
  1835. X#define VGA_reset PC_reset
  1836. X
  1837. X
  1838. X
  1839. X#ifdef EGALIB
  1840. X
  1841. X#define EGALIB_XMAX 640
  1842. X#define EGALIB_YMAX 350
  1843. X
  1844. X#define EGALIB_XLAST (EGA_XMAX - 1)
  1845. X#define EGALIB_YLAST (EGA_YMAX - 1)
  1846. X
  1847. X#define EGALIB_VCHAR 14
  1848. X#define EGALIB_HCHAR 8
  1849. X#define EGALIB_VTIC 4
  1850. X#define EGALIB_HTIC 5
  1851. X
  1852. X#include "mcega.h"
  1853. X
  1854. XEGALIB_init()
  1855. X{
  1856. X    GPPARMS();
  1857. X    if (GDTYPE != 5) {
  1858. X        term = 0;
  1859. X        int_error("color EGA board not found",NO_CARET);
  1860. X    }
  1861. X    egacolor = (GDMEMORY < 256) ? ega64color : ega256color;
  1862. X}
  1863. X
  1864. XEGALIB_graphics()
  1865. X{
  1866. X    graphics_on = TRUE;
  1867. X    GPINIT();
  1868. X}
  1869. X
  1870. XEGALIB_text()
  1871. X{
  1872. X    if (graphics_on) {
  1873. X        graphics_on = FALSE;
  1874. X        pause();
  1875. X    }
  1876. X    GPTERM();
  1877. X}
  1878. X
  1879. XEGALIB_linetype(linetype)
  1880. X{
  1881. X    if (linetype >= 13)
  1882. X        linetype %= 13;
  1883. X    GPCOLOR(egacolor[linetype+2]);
  1884. X}
  1885. X
  1886. XEGALIB_move(x,y)
  1887. X{
  1888. X    GPMOVE(x,GDMAXROW-y);
  1889. X}
  1890. X
  1891. X
  1892. XEGALIB_vector(x,y)
  1893. X{
  1894. X    GPLINE(x,GDMAXROW-y);
  1895. X}
  1896. X
  1897. X
  1898. XEGALIB_put_text(x,y,str)
  1899. Xint x, y;
  1900. Xchar *str;
  1901. X{
  1902. X    strcpy((char far *)buf,str);
  1903. X    GotoXY((int)(x/EGALIB_HCHAR),
  1904. X           (int)((EGALIB_YMAX-y-(EGALIB_VCHAR/2))/EGALIB_VCHAR));
  1905. X    gprintf(buf);
  1906. X}
  1907. X
  1908. X
  1909. X#define EGALIB_reset PC_reset
  1910. X
  1911. X#endif /* EGALIB */
  1912. X
  1913. X
  1914. X#ifdef HERCULES
  1915. X
  1916. X#define HERC_XMAX 720
  1917. X#define HERC_YMAX 348
  1918. X
  1919. X#define HERC_XLAST (HERC_XMAX - 1)
  1920. X#define HERC_YLAST (HERC_YMAX - 1)
  1921. X
  1922. X#define HERC_VCHAR PC_VCHAR
  1923. X#define HERC_HCHAR PC_HCHAR
  1924. X#define HERC_VTIC 4
  1925. X#define HERC_HTIC 5
  1926. X
  1927. Xint line_herc;
  1928. X
  1929. XHERC_init()
  1930. X{
  1931. X    H_init();
  1932. X}
  1933. X
  1934. XHERC_graphics()
  1935. X{
  1936. X    HVmode(1);
  1937. X    graphics_on = TRUE;
  1938. X}
  1939. X
  1940. XHERC_text()
  1941. X{
  1942. X    if (graphics_on) {
  1943. X        graphics_on = FALSE;
  1944. X        pause();
  1945. X    }
  1946. X    HVmode(0);
  1947. X}
  1948. X
  1949. XHERC_linetype(linetype)
  1950. X{
  1951. X    if (linetype >= 5)
  1952. X        linetype %= 5;
  1953. X    H_mask(pattern[linetype+2]);
  1954. X    line_herc = linetype;
  1955. X}
  1956. X
  1957. XHERC_move(x,y)
  1958. X{
  1959. X    if (x < 0)
  1960. X        startx = 0;
  1961. X    else if (x > HERC_XLAST)
  1962. X        startx = HERC_XLAST;
  1963. X    else
  1964. X        startx = x;
  1965. X
  1966. X    if (y < 0)
  1967. X        starty = 0;
  1968. X    else if (y > HERC_YLAST)
  1969. X        starty = HERC_YLAST;
  1970. X    else
  1971. X        starty = y;
  1972. X}
  1973. X
  1974. XHERC_vector(x,y)
  1975. X{
  1976. X    if (x < 0)
  1977. X        x = 0;
  1978. X    else if (x > HERC_XLAST)
  1979. X        x = HERC_XLAST;
  1980. X    if (y < 0)
  1981. X        y = 0;
  1982. X    else if (y > HERC_YLAST)
  1983. X        y = HERC_YLAST;
  1984. X
  1985. X    H_line(startx,HERC_YLAST-starty,x,HERC_YLAST-y);
  1986. X    startx = x;
  1987. X    starty = y;
  1988. X}
  1989. X
  1990. X
  1991. XHERC_put_text(x,y,str)
  1992. Xunsigned int x, y;
  1993. Xchar *str;
  1994. X{
  1995. Xint i;
  1996. Xint line;
  1997. X    line= line_herc;     /* disable the dotted lines temporarily */
  1998. X    H_mask(pattern[0]);
  1999. X    switch(pc_angle) {
  2000. X        case 0 : y -= HERC_VCHAR/2;
  2001. X                break;
  2002. X        case 1 : x += HERC_VCHAR/2;
  2003. X                break;
  2004. X    }
  2005. X    for (i=0;str[i];i++) {
  2006. X        PC_putc(x,HERC_YLAST-y,str[i],pc_angle,H_line);
  2007. X        switch(pc_angle) {
  2008. X            case 0 : x+=HERC_HCHAR ;
  2009. X                    break;
  2010. X            case 1 : y+=HERC_HCHAR ;
  2011. X                    break;
  2012. X        }
  2013. X    }
  2014. X    H_mask(pattern[line]);  /* enable dotted lines */
  2015. X}
  2016. X
  2017. X
  2018. X#define HERC_text_angle PC_text_angle
  2019. X
  2020. X#define HERC_reset PC_reset
  2021. X
  2022. X
  2023. X#endif /* HERCULES */
  2024. X
  2025. X
  2026. X/* thanks to sask!macphed (Geoff Coleman and Ian Macphedran) for the
  2027. X   ATT 6300 driver */ 
  2028. X
  2029. X
  2030. X#ifdef ATT6300
  2031. X
  2032. X#define ATT_XMAX 640
  2033. X#define ATT_YMAX 400
  2034. X
  2035. X#define ATT_XLAST (ATT_XMAX - 1)
  2036. X#define ATT_YLAST (ATT_YMAX - 1)
  2037. X
  2038. X#define ATT_VCHAR PC_VCHAR
  2039. X#define ATT_HCHAR PC_HCHAR
  2040. X#define ATT_VTIC 4
  2041. X#define ATT_HTIC 5
  2042. X
  2043. X#define ATT_init CGA_init
  2044. X
  2045. XATT_graphics()
  2046. X{
  2047. X    graphics_on = TRUE;
  2048. X    Vmode(0x40);        /* 40H is the magic number for the AT&T driver */
  2049. X}
  2050. X
  2051. X#define ATT_text CGA_text
  2052. X
  2053. X#define ATT_linetype CGA_linetype
  2054. X
  2055. X#define ATT_move CGA_move
  2056. X
  2057. XATT_vector(x,y)
  2058. X{
  2059. X    PC_line(startx,ATT_YLAST-starty,x,ATT_YLAST-y);
  2060. X    startx = x;
  2061. X    starty = y;
  2062. X}
  2063. X
  2064. X
  2065. XATT_put_text(x,y,str)
  2066. Xunsigned int x, y;
  2067. Xchar *str;
  2068. X{
  2069. Xint i;
  2070. Xint line;
  2071. X    line= line_cga;     /* disable the dotted lines temporarily */
  2072. X    PC_mask(pattern[0]);
  2073. X    switch(pc_angle) {
  2074. X        case 0 : y -= ATT_VCHAR/2;
  2075. X                break;
  2076. X        case 1 : x += ATT_VCHAR/2;
  2077. X                break;
  2078. X    }
  2079. X    for (i=0;str[i];i++) {
  2080. X        PC_putc(x,ATT_YLAST-y,str[i],pc_angle,PC_line);
  2081. X        switch(pc_angle) {
  2082. X            case 0 : x+=ATT_HCHAR ;
  2083. X                    break;
  2084. X            case 1 : y+=ATT_HCHAR ;
  2085. X                    break;
  2086. X        }
  2087. X    }
  2088. X    PC_mask(pattern[line]);  /* enable dotted lines */
  2089. X}
  2090. X
  2091. X
  2092. X#define ATT_text_angle PC_text_angle
  2093. X
  2094. X#define ATT_reset CGA_reset
  2095. X
  2096. X#endif  /* ATT6300 */
  2097. X
  2098. X
  2099. X#ifdef CORONA
  2100. X
  2101. X#define COR_XMAX 640
  2102. X#define COR_YMAX 325
  2103. X
  2104. X#define COR_XLAST (COR_XMAX - 1)
  2105. X#define COR_YLAST (COR_YMAX - 1)
  2106. X
  2107. X#define COR_VCHAR PC_VCHAR
  2108. X#define COR_HCHAR PC_HCHAR
  2109. X#define COR_VTIC 4
  2110. X#define COR_HTIC 5
  2111. X
  2112. Xint line_cor;
  2113. X
  2114. Xstatic int corscreen;        /* screen number, 0 - 7 */
  2115. X
  2116. XCOR_init()
  2117. X{
  2118. Xregister char *p;
  2119. X    if (!(p = getenv("CORSCREEN")))
  2120. X        int_error("must run CORPLOT for Corona graphics",NO_CARET);
  2121. X    corscreen = *p - '0';
  2122. X}
  2123. X
  2124. XCOR_graphics()
  2125. X{
  2126. X    graphics_on = TRUE;
  2127. X    Vmode(3);                /* clear text screen */
  2128. X    grinit(corscreen);
  2129. X    grandtx();
  2130. X}
  2131. X
  2132. XCOR_text()
  2133. X{
  2134. X    if (graphics_on) {
  2135. X        graphics_on = FALSE;
  2136. X        pause();
  2137. X    }
  2138. X    grreset();
  2139. X    txonly();
  2140. X    Vmode(3);
  2141. X}
  2142. X
  2143. XCOR_linetype(linetype)
  2144. X{
  2145. X    if (linetype >= 5)
  2146. X        linetype %= 5;
  2147. X    line_cor = linetype;
  2148. X    Cor_mask(pattern[linetype+2]);
  2149. X}
  2150. X
  2151. XCOR_move(x,y)
  2152. X{
  2153. X    if (x < 0)
  2154. X        startx = 0;
  2155. X    else if (x > COR_XLAST)
  2156. X        startx = COR_XLAST;
  2157. X    else
  2158. X        startx = x;
  2159. X
  2160. X    if (y < 0)
  2161. X        starty = 0;
  2162. X    else if (y > COR_YLAST)
  2163. X        starty = COR_YLAST;
  2164. X    else
  2165. X        starty = y;
  2166. X}
  2167. X
  2168. XCOR_vector(x,y)
  2169. X{
  2170. X    if (x < 0)
  2171. X        x = 0;
  2172. X    else if (x > COR_XLAST)
  2173. X        x = COR_XLAST;
  2174. X    if (y < 0)
  2175. X        y = 0;
  2176. X    else if (y > COR_YLAST)
  2177. X        y = COR_YLAST;
  2178. X
  2179. X    Cor_line(startx,COR_YLAST-starty,x,COR_YLAST-y);
  2180. X    startx = x;
  2181. X    starty = y;
  2182. X}
  2183. X
  2184. X
  2185. XCOR_put_text(x,y,str)
  2186. Xunsigned int x, y;
  2187. Xchar *str;
  2188. X{
  2189. Xint i;
  2190. Xint line;
  2191. X    line= line_cor;     /* disable the dotted lines temporarily */
  2192. X    Cor_mask(pattern[0]);
  2193. X    switch(pc_angle) {
  2194. X        case 0 : y -= COR_VCHAR/2;
  2195. X                break;
  2196. X        case 1 : x += COR_VCHAR/2;
  2197. X                break;
  2198. X    }
  2199. X    for (i=0;str[i];i++) {
  2200. X        PC_putc(x,COR_YLAST-y,str[i],pc_angle,Cor_line);
  2201. X        switch(pc_angle) {
  2202. X            case 0 : x+=COR_HCHAR ;
  2203. X                    break;
  2204. X            case 1 : y+=COR_HCHAR ;
  2205. X                    break;
  2206. X        }
  2207. X    }
  2208. X    COR_mask(pattern[line]);  /* enable dotted lines */
  2209. X}
  2210. X
  2211. X
  2212. X#define COR_text_angle PC_text_angle
  2213. X
  2214. X#define COR_reset PC_reset
  2215. X
  2216. X#endif /* CORONA */
  2217. X
  2218. X
  2219. X#else /* ifndef __TURBOC__ */
  2220. X/* all of the Turbo C routines for the different graphics devices go here */
  2221. X
  2222. X#define VGA_XMAX 640
  2223. X#define VGA_YMAX 480
  2224. X
  2225. X#define VGA_XLAST (VGA_XMAX - 1)
  2226. X#define VGA_YLAST (VGA_YMAX - 1)
  2227. X
  2228. X#define VGA_VCHAR 10
  2229. X#define VGA_HCHAR 8
  2230. X#define VGA_VTIC 4
  2231. X#define VGA_HTIC 5
  2232. X
  2233. X#define SVGA_XMAX 640
  2234. X#define SVGA_YMAX 480
  2235. X
  2236. X#define SVGA_VCHAR 10
  2237. X#define SVGA_HCHAR 8
  2238. X#define SVGA_VTIC 4
  2239. X#define SVGA_HTIC 5
  2240. X
  2241. Xstatic int vga256color[] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};
  2242. Xstatic int *vgacolor;
  2243. X
  2244. Xstatic int svga_xmax = SVGA_XMAX,
  2245. X       svga_ymax = SVGA_YMAX,
  2246. X       svga_xlast = 639,
  2247. X       svga_ylast = 479;
  2248. X
  2249. X#define VGA_reset EGALIB_reset
  2250. X#define VGA_text EGALIB_text
  2251. X#define VGA_move EGALIB_move
  2252. X#define VGA_vector EGALIB_vector
  2253. X#define VGA_text_angle PC_text_angle
  2254. X#define VGA_justify_text PC_justify_text
  2255. X
  2256. X#define SVGA_reset EGALIB_reset
  2257. X#define SVGA_text EGALIB_text
  2258. X#define SVGA_move EGALIB_move
  2259. X#define SVGA_vector EGALIB_vector
  2260. X#define SVGA_text_angle PC_text_angle
  2261. X#define SVGA_justify_text PC_justify_text
  2262. X#define SVGA_linetype VGA_linetype
  2263. X
  2264. Xint PC_text_angle(ang)
  2265. Xint ang;
  2266. X{
  2267. X    int size = svga_ymax > 600 ? 2 : 1;
  2268. X
  2269. X    pc_angle = ang;
  2270. X
  2271. X    switch (ang) {
  2272. X        case 0 : settextstyle(DEFAULT_FONT,HORIZ_DIR,size);
  2273. X            break;
  2274. X        case 1 : settextstyle(DEFAULT_FONT,VERT_DIR,size);
  2275. X            break;
  2276. X    }
  2277. X    return TRUE;
  2278. X}
  2279. X
  2280. Xint PC_justify_text(mode)
  2281. Xenum JUSTIFY mode;
  2282. X{
  2283. X    switch(mode) {
  2284. X        case LEFT :
  2285. X            settextjustify(LEFT_TEXT,CENTER_TEXT);
  2286. X            break;
  2287. X        case CENTRE :
  2288. X            settextjustify(CENTER_TEXT,CENTER_TEXT);
  2289. X            break;
  2290. X        case RIGHT:
  2291. X            settextjustify(RIGHT_TEXT,CENTER_TEXT);
  2292. X            break;
  2293. X    }
  2294. X    return TRUE;
  2295. X}
  2296. X
  2297. XVGA_init()
  2298. X{
  2299. X    g_driver=VGA;
  2300. X    g_mode=2;
  2301. X    gettextinfo(&tinfo);
  2302. X        initgraph(&g_driver,&g_mode,path);
  2303. X        if(g_driver!=9){
  2304. X          term=0;
  2305. X          switch (g_driver){
  2306. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2307. X                     break;
  2308. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2309. X                     break;
  2310. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2311. X                     break;
  2312. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2313. X                             "graphics driver.");
  2314. X                     break;
  2315. X            }
  2316. X
  2317. X/*          int_error("color VGA board not found",NO_CARET);*/
  2318. X        }
  2319. X        if(g_driver==VGA) vgacolor=vga256color;
  2320. X}
  2321. X
  2322. XVGA_graphics()
  2323. X{       g_driver=VGA;
  2324. X    g_mode=2;
  2325. X    graphics_on = TRUE;
  2326. X    gettextinfo(&tinfo);
  2327. X    setgraphmode(getgraphmode());
  2328. X    VGA_justify_text(LEFT);
  2329. X}
  2330. X
  2331. XVGA_linetype(linetype)
  2332. X{
  2333. X    if (linetype >= 13)
  2334. X        linetype %= 13;
  2335. X    setcolor(vgacolor[linetype+2]);
  2336. X}
  2337. X
  2338. XVGA_put_text(x,y,str)
  2339. Xunsigned int x, y;
  2340. Xchar *str;
  2341. X{
  2342. X    strcpy((char far *)buf,str);
  2343. X    outtextxy(x,VGA_YLAST-y,buf);
  2344. X}
  2345. X
  2346. X
  2347. XVGAMONO_linetype(linetype)
  2348. X{
  2349. X    if (linetype >= 5)
  2350. X        linetype %= 5;
  2351. X    setlinestyle(4,pattern[linetype+2],1);
  2352. X}
  2353. X
  2354. Xstatic int huge detect_svga(void)
  2355. X{
  2356. X    return g_mode;
  2357. X}
  2358. X
  2359. XSVGA_init()
  2360. X{
  2361. X    char *p, name[128], *SVGA = getenv( "SVGA" );
  2362. X
  2363. X    if (SVGA == NULL)
  2364. X        int_error("'SVGA' driver environment variable is not set",
  2365. X              NO_CARET);
  2366. X
  2367. X    strcpy(name, SVGA);
  2368. X    if ((p = strrchr(name, '.')) == NULL ||
  2369. X        sscanf(&p[1], "%d", &g_mode) != 1)
  2370. X        int_error("'SVGA' envvar should be of the form 'name.mode'",
  2371. X              NO_CARET);
  2372. X
  2373. X    *p = 0;
  2374. X
  2375. X    installuserdriver(name, detect_svga);
  2376. X    gettextinfo(&tinfo);
  2377. X    g_driver = 0;
  2378. X    get_path();
  2379. X        initgraph(&g_driver,&g_mode,path);
  2380. X        if(g_driver<0){
  2381. X          term=0;
  2382. X          switch (g_driver){
  2383. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2384. X                     break;
  2385. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2386. X                     break;
  2387. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2388. X                     break;
  2389. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2390. X                             "graphics driver.");
  2391. X                     break;
  2392. X            }
  2393. X
  2394. X        }
  2395. X    else
  2396. X        vgacolor=vga256color;
  2397. X
  2398. X    /* Get the screen size: */
  2399. X    svga_xmax = term_tbl[term].xmax = getmaxx() + 1;
  2400. X        svga_ymax = term_tbl[term].ymax = getmaxy() + 1;
  2401. X    svga_xlast = svga_xmax-1;
  2402. X    svga_ylast = svga_ymax-1;
  2403. X
  2404. X    if (svga_ymax > 600) {               /* Double the tic/font sizes. */
  2405. X        term_tbl[term].h_char = SVGA_HCHAR * 2;
  2406. X        term_tbl[term].v_char = SVGA_VCHAR * 2;
  2407. X        term_tbl[term].h_tic = SVGA_HTIC * 2;
  2408. X        term_tbl[term].v_tic = SVGA_VTIC * 2;
  2409. X        settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
  2410. X     }
  2411. X    else
  2412. X        settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
  2413. X}
  2414. X
  2415. XSVGA_graphics()
  2416. X{
  2417. X    graphics_on = TRUE;
  2418. X    gettextinfo(&tinfo);
  2419. X    setgraphmode(getgraphmode());
  2420. X    VGA_justify_text(LEFT);
  2421. X
  2422. X        svga_ymax = getmaxy() + 1;
  2423. X    if (svga_ymax > 600)               /* Double the tic/font sizes. */
  2424. X        settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
  2425. X    else
  2426. X        settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
  2427. X}
  2428. X
  2429. XSVGA_put_text(x,y,str)
  2430. Xunsigned int x, y;
  2431. Xchar *str;
  2432. X{
  2433. X    strcpy((char far *)buf,str);
  2434. X    outtextxy(x,svga_ylast-y,buf);
  2435. X}
  2436. X
  2437. X#define MCGA_XMAX 640
  2438. X#define MCGA_YMAX 480
  2439. X
  2440. X#define MCGA_XLAST (MCGA_XMAX - 1)
  2441. X#define MCGA_YLAST (MCGA_YMAX - 1)
  2442. X
  2443. X#define MCGA_VCHAR 10
  2444. X#define MCGA_HCHAR 8
  2445. X#define MCGA_VTIC 4
  2446. X#define MCGA_HTIC 5
  2447. X
  2448. Xstatic int *MCGAcolor;
  2449. X
  2450. X#define MCGA_reset EGALIB_reset
  2451. X#define MCGA_text EGALIB_text
  2452. X#define MCGA_move EGALIB_move
  2453. X#define MCGA_vector EGALIB_vector
  2454. X#define MCGA_text_angle PC_text_angle
  2455. X#define MCGA_justify_text PC_justify_text
  2456. X
  2457. XMCGA_init()
  2458. X{
  2459. X    g_driver=MCGA;
  2460. X    g_mode=5;
  2461. X    gettextinfo(&tinfo);
  2462. X        initgraph(&g_driver,&g_mode,path);
  2463. X        if(g_driver!=2){
  2464. X          term=0;
  2465. X          switch (g_driver){
  2466. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2467. X                     break;
  2468. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2469. X                     break;
  2470. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2471. X                     break;
  2472. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2473. X                             "graphics driver.");
  2474. X                     break;
  2475. X            }
  2476. X        }
  2477. X}
  2478. X
  2479. XMCGA_graphics()
  2480. X{
  2481. X    graphics_on = TRUE;
  2482. X    gettextinfo(&tinfo);
  2483. X    setgraphmode(getgraphmode());
  2484. X    MCGA_justify_text(LEFT);
  2485. X}
  2486. X
  2487. X
  2488. XMCGA_put_text(x,y,str)
  2489. Xunsigned int x, y;
  2490. Xchar *str;
  2491. X{
  2492. X    strcpy((char far *)buf,str);
  2493. X    outtextxy(x,MCGA_YLAST-y,buf);
  2494. X}
  2495. X
  2496. X
  2497. XMCGA_linetype(linetype)
  2498. X{
  2499. X    if (linetype >= 5)
  2500. X        linetype %= 5;
  2501. X    setlinestyle(4,pattern[linetype+2],1);
  2502. X}
  2503. X
  2504. X
  2505. X#define EGALIB_XMAX 640
  2506. X#define EGALIB_YMAX 350
  2507. X
  2508. X#define EGALIB_XLAST (EGALIB_XMAX - 1)
  2509. X#define EGALIB_YLAST (EGALIB_YMAX - 1)
  2510. X
  2511. X#define EGALIB_VCHAR 10
  2512. X#define EGALIB_HCHAR 8
  2513. X#define EGALIB_VTIC 4
  2514. X#define EGALIB_HTIC 5
  2515. X
  2516. Xstatic int ega64color[] =  {1,1,5,4,3,5,4,3, 5, 4, 3, 5, 4, 3,5};
  2517. Xstatic int ega256color[] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};
  2518. X
  2519. Xstatic int *egacolor;
  2520. X
  2521. X#define EGALIB_text_angle PC_text_angle
  2522. X#define EGALIB_justify_text PC_justify_text
  2523. X
  2524. XEGALIB_init()
  2525. X{
  2526. X    g_driver=EGA;
  2527. X    g_mode=1;
  2528. X    gettextinfo(&tinfo);
  2529. X        initgraph(&g_driver,&g_mode,path);
  2530. X        if(g_driver<3 || g_driver>4){
  2531. X          term=0;
  2532. X          switch (g_driver){
  2533. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2534. X                     break;
  2535. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2536. X                     break;
  2537. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2538. X                     break;
  2539. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2540. X                             "graphics driver.");
  2541. X                     break;
  2542. X            }
  2543. X
  2544. X/*          int_error("color EGA board not found",NO_CARET);*/
  2545. X        }
  2546. X        if(g_driver==EGA) egacolor=ega256color;
  2547. X        if(g_driver==EGA64) egacolor=ega64color;
  2548. X}
  2549. X
  2550. XEGALIB_graphics()
  2551. X{
  2552. X    graphics_on = TRUE;
  2553. X    gettextinfo(&tinfo);
  2554. X    setgraphmode(getgraphmode());
  2555. X    EGALIB_justify_text(LEFT);
  2556. X}
  2557. X
  2558. XEGALIB_text()
  2559. X{
  2560. X    if (graphics_on) {
  2561. X        graphics_on = FALSE;
  2562. X        pause();
  2563. X    }
  2564. X    restorecrtmode();
  2565. X        textmode(tinfo.currmode);
  2566. X    clrscr();
  2567. X    svga_ymax = SVGA_YMAX; /* Since it may double font size if too high. */
  2568. X}
  2569. X
  2570. XEGALIB_linetype(linetype)
  2571. X{
  2572. X    if (linetype >= 13)
  2573. X        linetype %= 13;
  2574. X    setcolor(egacolor[linetype+2]);
  2575. X}
  2576. X
  2577. XEGALIB_move(x,y)
  2578. X{
  2579. X        moveto(x,getmaxy()-y);
  2580. X}
  2581. X
  2582. X
  2583. XEGALIB_vector(x,y)
  2584. X{
  2585. X    lineto(x,getmaxy()-y);
  2586. X}
  2587. X
  2588. X
  2589. XEGALIB_put_text(x,y,str)
  2590. Xunsigned int x, y;
  2591. Xchar *str;
  2592. X{
  2593. X    strcpy((char far *)buf,str);
  2594. X    outtextxy(x,EGALIB_YLAST-y,buf);
  2595. X}
  2596. X
  2597. X
  2598. XEGALIB_reset()
  2599. X{
  2600. X      closegraph();
  2601. X        textmode(tinfo.currmode);
  2602. X    clrscr();
  2603. X    svga_ymax = SVGA_YMAX; /* Since it may double font size if too high. */
  2604. X}
  2605. X
  2606. X
  2607. X#define CGA_XMAX 640
  2608. X#define CGA_YMAX 200
  2609. X
  2610. X#define CGA_XLAST (CGA_XMAX - 1)
  2611. X#define CGA_YLAST (CGA_YMAX - 1)
  2612. X
  2613. X#define CGA_VCHAR 10
  2614. X#define CGA_HCHAR 8
  2615. X#define CGA_VTIC 4
  2616. X#define CGA_HTIC 6
  2617. X
  2618. X#define CGA_text_angle PC_text_angle
  2619. X#define CGA_justify_text PC_justify_text
  2620. X#define CGA_reset PC_reset
  2621. X
  2622. XCGA_init()
  2623. X{
  2624. X    g_driver=CGA;
  2625. X    g_mode=4;
  2626. X    gettextinfo(&tinfo);
  2627. X    initgraph(&g_driver,&g_mode,path);
  2628. X          switch (g_driver){
  2629. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2630. X                     break;
  2631. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2632. X                     break;
  2633. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2634. X                     break;
  2635. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2636. X                             "graphics driver.");
  2637. X                     break;
  2638. X            }
  2639. X/*    PC_color(1);         monochrome */
  2640. X
  2641. X}
  2642. X
  2643. XCGA_graphics()
  2644. X{
  2645. X    graphics_on = TRUE;
  2646. X    gettextinfo(&tinfo);
  2647. X    setgraphmode(getgraphmode());
  2648. X    CGA_justify_text(LEFT);
  2649. X    /*    Vmode(6);*/
  2650. X}
  2651. X
  2652. X#define CGA_text PC_text
  2653. X
  2654. XCGA_linetype(linetype)
  2655. X{
  2656. X    if (linetype >= 5)
  2657. X        linetype %= 5;
  2658. X    setlinestyle(4,pattern[linetype+2],1);
  2659. X}
  2660. X
  2661. XCGA_move(x,y)
  2662. X{
  2663. X    moveto(x,getmaxy()-y);
  2664. X}
  2665. X
  2666. X
  2667. XCGA_vector(x,y)
  2668. X{
  2669. X    lineto(x,getmaxy()-y);
  2670. X}
  2671. X
  2672. XCGA_put_text(x,y,str)
  2673. Xunsigned int x, y;
  2674. Xchar *str;
  2675. X{
  2676. X    strcpy((char far *)buf,str);
  2677. X    outtextxy(x,CGA_YLAST-y,buf);
  2678. X}
  2679. X
  2680. X
  2681. X
  2682. X#define HERC_XMAX 720
  2683. X#define HERC_YMAX 348
  2684. X
  2685. X#define HERC_XLAST (HERC_XMAX - 1)
  2686. X#define HERC_YLAST (HERC_YMAX - 1)
  2687. X
  2688. X#define HERC_VCHAR 10
  2689. X#define HERC_HCHAR 8
  2690. X#define HERC_VTIC 4
  2691. X#define HERC_HTIC 5
  2692. X
  2693. X#define HERC_text_angle PC_text_angle
  2694. X#define HERC_justify_text PC_justify_text
  2695. X#define HERC_reset PC_reset
  2696. X
  2697. XHERC_init()
  2698. X{
  2699. X    g_driver=HERCMONO;
  2700. X    g_mode=0;
  2701. X    gettextinfo(&tinfo);
  2702. X      initgraph(&g_driver,&g_mode,path);
  2703. X          switch (g_driver){
  2704. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2705. X                     break;
  2706. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2707. X                     break;
  2708. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2709. X                     break;
  2710. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2711. X                             "graphics driver.");
  2712. X                     break;
  2713. X            }
  2714. X}
  2715. X
  2716. XHERC_graphics()
  2717. X{
  2718. X    gettextinfo(&tinfo);
  2719. X    setgraphmode(getgraphmode());
  2720. X    HERC_justify_text(LEFT);
  2721. X    graphics_on = TRUE;
  2722. X}
  2723. X
  2724. XHERC_text()
  2725. X{
  2726. X    if (graphics_on) {
  2727. X        graphics_on = FALSE;
  2728. X        pause();
  2729. X    }
  2730. X    restorecrtmode();
  2731. X        textmode(tinfo.currmode);
  2732. X    clrscr();
  2733. X}
  2734. X
  2735. XHERC_linetype(linetype)
  2736. X{
  2737. X    if (linetype >= 5)
  2738. X        linetype %= 5;
  2739. X    setlinestyle(4,pattern[linetype+2],1);
  2740. X}
  2741. X
  2742. XHERC_move(x,y)
  2743. X{
  2744. X    if (x < 0)
  2745. X        x = 0;
  2746. X    else if (x > HERC_XLAST)
  2747. X        x = HERC_XLAST;
  2748. X
  2749. X    if (y < 0)
  2750. X        y = 0;
  2751. X    else if (y > HERC_YLAST)
  2752. X        y = HERC_YLAST;
  2753. X    moveto(x,getmaxy()-y);
  2754. X}
  2755. X
  2756. XHERC_vector(x,y)
  2757. X{
  2758. X    if (x < 0)
  2759. X        x = 0;
  2760. X    else if (x > HERC_XLAST)
  2761. X        x = HERC_XLAST;
  2762. X    if (y < 0)
  2763. X        y = 0;
  2764. X    else if (y > HERC_YLAST)
  2765. X        y = HERC_YLAST;
  2766. X
  2767. X    lineto(x,getmaxy()-y);
  2768. X}
  2769. X
  2770. X
  2771. XHERC_put_text(x,y,str)
  2772. Xunsigned int x, y;
  2773. Xchar *str;
  2774. X{
  2775. X    strcpy((char far *)buf,str);
  2776. X    outtextxy(x,HERC_YLAST-y,buf);
  2777. X}
  2778. X
  2779. X
  2780. X#ifdef ATT6300
  2781. X/* this driver added by rjl@monu1.cc.monash.edu.au */
  2782. X
  2783. X#define ATT_XMAX 640
  2784. X#define ATT_YMAX 400
  2785. X
  2786. X#define ATT_XLAST (ATT_XMAX - 1)
  2787. X#define ATT_YLAST (ATT_YMAX - 1)
  2788. X
  2789. X#define ATT_VCHAR PC_VCHAR
  2790. X#define ATT_HCHAR PC_HCHAR
  2791. X#define ATT_VTIC 4
  2792. X#define ATT_HTIC 5
  2793. X
  2794. X#define ATT_text_angle PC_text_angle
  2795. X#define ATT_justify_text PC_justify_text
  2796. X#define ATT_reset PC_reset
  2797. X
  2798. XATT_init()
  2799. X{
  2800. X    g_driver=ATT400;
  2801. X    g_mode=5;
  2802. X    gettextinfo(&tinfo);
  2803. X      initgraph(&g_driver,&g_mode,path);
  2804. X          switch (g_driver){
  2805. X            case -2: fprintf(stderr,"Graphics card not detected.\n");
  2806. X                     break;
  2807. X            case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  2808. X                     break;
  2809. X            case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  2810. X                     break;
  2811. X            case -5: fprintf(stderr,"Insufficient memory to load ",
  2812. X                             "graphics driver.");
  2813. X                     break;
  2814. X            }
  2815. X}
  2816. X
  2817. XATT_graphics()
  2818. X{
  2819. X    gettextinfo(&tinfo);
  2820. X    setgraphmode(getgraphmode());
  2821. X    ATT_justify_text(LEFT);
  2822. X    graphics_on = TRUE;
  2823. X}
  2824. X
  2825. XATT_text()
  2826. X{
  2827. X    if (graphics_on) {
  2828. X        graphics_on = FALSE;
  2829. X        pause();
  2830. X    }
  2831. X    restorecrtmode();
  2832. X        textmode(tinfo.currmode);
  2833. X    clrscr();
  2834. X}
  2835. X
  2836. XATT_linetype(linetype)
  2837. X{
  2838. X    if (linetype >= 5)
  2839. X        linetype %= 5;
  2840. X    setlinestyle(4,pattern[linetype+2],1);
  2841. X}
  2842. X
  2843. XATT_move(x,y)
  2844. X{
  2845. X    if (x < 0)
  2846. X        x = 0;
  2847. X    else if (x > ATT_XLAST)
  2848. X        x = ATT_XLAST;
  2849. X
  2850. X    if (y < 0)
  2851. X        y = 0;
  2852. X    else if (y > ATT_YLAST)
  2853. X        y = ATT_YLAST;
  2854. X    moveto(x,getmaxy()-y);
  2855. X}
  2856. X
  2857. XATT_vector(x,y)
  2858. X{
  2859. X    if (x < 0)
  2860. X        x = 0;
  2861. X    else if (x > ATT_XLAST)
  2862. X        x = ATT_XLAST;
  2863. X    if (y < 0)
  2864. X        y = 0;
  2865. X    else if (y > ATT_YLAST)
  2866. X        y = ATT_YLAST;
  2867. X
  2868. X    lineto(x,getmaxy()-y);
  2869. X}
  2870. X
  2871. X
  2872. XATT_put_text(x,y,str)
  2873. Xunsigned int x, y;
  2874. Xchar *str;
  2875. X{
  2876. X    strcpy((char far *)buf,str);
  2877. X    outtextxy(x,ATT_YLAST-y,buf);
  2878. X}
  2879. X#endif /* ifdef ATT6300 */
  2880. X
  2881. X#endif /* ifndef __TURBOC__ */
  2882. X
  2883. END_OF_FILE
  2884.   if test 25354 -ne `wc -c <'gnuplot/term/pc.trm'`; then
  2885.     echo shar: \"'gnuplot/term/pc.trm'\" unpacked with wrong size!
  2886.   fi
  2887.   # end of 'gnuplot/term/pc.trm'
  2888. fi
  2889. echo shar: End of archive 15 \(of 33\).
  2890. cp /dev/null ark15isdone
  2891. MISSING=""
  2892. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2893.     if test ! -f ark${I}isdone ; then
  2894.     MISSING="${MISSING} ${I}"
  2895.     fi
  2896. done
  2897. if test "${MISSING}" = "" ; then
  2898.     echo You have unpacked all 33 archives.
  2899.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2900. else
  2901.     echo You still must unpack the following archives:
  2902.     echo "        " ${MISSING}
  2903. fi
  2904. exit 0
  2905. exit 0 # Just in case...
  2906.