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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
|
* Please note that this is not the current official FAQ since
* I have upgraded the info in answer 4.0 - dd
Archive-name: graphics/gnuplot-faq
Version: Mon Sep 23 04:23:01 CES 1996
Posting-frequency: every 14 days
URL: http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/
comp.graphics.apps.gnuplot
comp.graphics.apps.gnuplot FAQ (Frequent Answered Questions)
This is the FAQ (Frequently Answered Questions) list of the
comp.graphics.apps.gnuplot newsgroup, which discusses the gnuplot
program for plotting 2D - and 3D - graphs.
Most of the information in this document came from public discussion
on comp.graphics.apps.gnuplot; quotations are believed to be in the
public domain.
If you are reading this via WWW, and you can't access the individual
pages, please select here, then try again.
Here's a list of the questions. If you are looking for the answer for
a specific question, look for the string Qx.x: at the beginning of a
line, with x.x being the question number. Sections in this FAQ are
* 0. Meta-Questions
* 1. General Information
* 2. Setting it up
* 3. Working with it
* 4. Wanted features
* 5. Miscellaneous
* 6. Making life easier
* 7. Known problems
* 8. Credits
Questions:
Section 0: Meta - Questions
* Q0.1: Where do I get this document?
* Q0.2: Where do I send comments about this document?
Section 1: General Information
* Q1.1: What is gnuplot?
* Q1.2: How did it come about and why is it called gnuplot?
* Q1.3: Does gnuplot have anything to do with the FSF and the
GNU project?
* Q1.4: What does gnuplot offer?
* Q1.5: Is gnuplot suitable for batch processing?
* Q1.6: Can I run gnuplot on my computer?
Section 2: Setting it up
* Q2.1: What is the current version of gnuplot?
* Q2.2: Where can I get gnuplot?
* Q2.3: How do I get gnuplot to compile on my system?
* Q2.4: What documentation is there, and how do I get it?
Section 3: Working with it
* Q3.1: How do I get help?
* Q3.2: How do I print out my graphs?
* Q3.3: How do I include my graphs in <word processor>?
* Q3.4: How do I post-process a gnuplot graph?
* Q3.5: How do I change symbol size, line thickness and the
like?
* Q3.6: How do I generate plots in GIF format?
Section 4: Wanted features
* Q4.0: What's new in gnuplot 3.6?
* Q4.1: Does gnuplot have hidden line removal?
* Q4.2: Does gnuplot support bar-charts/histograms/boxes?
* Q4.3: Does gnuplot support multiple y-axes on a single plot?
* Q4.4: Can I put multiple plots on a single page?
* Q4.5: Can I put both data files and commands into a single
file?
* Q4.6: Can I put Greek letters and super/subscripts into my
labels?
* Q4.7 Can I do 1:1 scaling of axes?
* Q4.8: Can I put tic marks for x and y axes into 3d plots?
* Q4.9: Does gnuplot support a driver for <graphics format>?
* Q4.10: Can I put different text sizes into my plots?
* Q4.11: How do I modify gnuplot?
* Q4.12: How do I skip data points?
Section 5: Miscellaneous
* Q5.1: I've found a bug, what do I do?
* Q5.2: Can I use gnuplot routines for my own programs?
* Q5.3: What extensions have people made to gnuplot? Where can I
get them?
* Q5.4: Can I do heavy-duty data processing with gnuplot?
* Q5.5: I have ported gnuplot to another system, or patched it.
What do I do?
* Q5.6: I want to help in developing gnuplot 3.6. What can I do?
Section 6: Making life easier
* Q6.1: How do I plot two functions in non-overlapping regions?
* Q6.2: How do I run my data through a filter before plotting?
* Q6.3: How do I make it easier to use gnuplot with LaTeX?
* Q6.4: How do I save and restore my settings?
* Q6.5: How do I plot lines (not grids) using splot?
* Q6.6: How do I plot a function f(x,y) which is bounded by
other functions in the x-y plain?
* Q6.7: How do I get rid of <feature in a plot>?
* Q6.8: How do I call gnuplot from my own programs ?
Section 7: Known Problems
* Q7.1: Gnuplot is not plotting any points under X11! How come?
* Q7.2: My isoline data generated by a Fortran program is not
handled correctly. What can I do?
* Q7.3: Why does gnuplot ignore my very small numbers?
* Q7.4: Gnuplot is plotting nothing when run via gnuplot
<filename>! What can I do?
* Q7.5: My formulas are giving me nonsense results! What's going
on?
* Q7.6: My Linux gnuplot complains about a missing gnuplot_x11.
What is wrong?
* Q7.7: set output 'filename' isn't outputting everything it
should!
Section 8: Credits
Section 0: Meta-Questions.
Q0.1: Where do I get this document?
This document is posted about once every two weeks to the
newsgroups comp.graphics.apps.gnuplot, comp.answers and
news.answers. Like many other FAQ's, its newest (plaintext)
version is available via anonymous ftp from
ftp://rtfm.mit.edu/pub/usenet/news.answers/graphics/gnuplot
-faq.
If you have access to the WWW, you can get the newest version
of this document from
http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/
Q0.2: Where do I send comments about this document?
Send comments, suggestions etc. via e-mail to Thomas
Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de or
ig25@dkauni2.bitnet.
Section 1: General Information
Q1.1: What is gnuplot?
Gnuplot is a command-driven interactive function plotting
program. It can be used to plot functions and data points in
both two- and three- dimensional plots in many different
formats, and will accommodate many of the needs of today's
scientists for graphic data representation. Gnuplot is
copyrighted, but freely distributable; you don't have to pay
for it.
Q1.2: How did it come about and why is it called gnuplot?
The authors of gnuplot are:
Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John
Campbell, Gershon Elber, Alexander Woo and many others.
The following quote comes from Thomas Williams:
I was taking a differential equation class and Colin was taking
Electromagnetics, we both thought it'd be helpful to visualize the
mathematics behind them. We were both working as sys admin for an
EE VLSI lab, so we had the graphics terminals and the time to do
some coding. The posting was better received than we expected, and
prompted us to add some, albeit lame, support for file data.
Any reference to GNUplot is incorrect. The real name of the program
is "gnuplot". You see people use "Gnuplot" quite a bit because many
of us have an aversion to starting a sentence with a lower case
letter, even in the case of proper nouns and titles. Gnuplot is not
related to the GNU project or the FSF in any but the most
peripheral sense. Our software was designed completely
independently and the name "gnuplot" was actually a compromise. I
wanted to call it "llamaplot" and Colin wanted to call it "nplot."
We agreed that "newplot" was acceptable but, we then discovered
that there was an absolutely ghastly pascal program of that name
that the Computer Science Dept. occasionally used. I decided that
"gnuplot" would make a nice pun and after a fashion Colin agreed.
Q1.3: Does gnuplot have anything to do with the FSF and the GNU
project?
Gnuplot is neither written nor maintained by the FSF. It is not
covered by the General Public License, either.
However, the FSF has decided to distribute gnuplot as part of
the GNU system, because it is useful, redistributable software.
Q1.4: What does gnuplot offer?
+ Plotting of two-dimensional functions and data points in many
different styles (points, lines, error bars)
+ plotting of three-dimensional data points and surfaces in
many different styles (contour plot, mesh).
+ support for complex arithmetic
+ self - defined functions
+ support for a large number of operating systems, graphics
file formats and devices
+ extensive on-line help
+ labels for title, axes, data points
+ command line editing and history on most platforms
Q1.5: Is gnuplot suitable for batch processing?
Yes. You can read in files from the command line, or you can
redirect your standard input to read from a file. Both data and
command files can be generated automatically, from data
acquisition programs or whatever else you use.
Q1.6: Can I run gnuplot on my computer?
Gnuplot is available for a number of platforms. These are: Unix
(X11 and NeXTSTEP), VAX/VMS, OS/2, MS-DOS, Amiga, MS-Windows,
OS-9/68k, Atari ST and the Macintosh. Modifications for NEC
PC-9801 are said to exist (where?).
Section 2: Setting it up
Q2.1: What is the current version of gnuplot?
The current version of gnuplot is 3.5, which is a bugfix
release over 3.4.
Version 3.6 is in beta status. Please note that this is still
unstable, and may not compile correctly on your system.
Q2.2: Where can I get gnuplot?
All of the later addresses refer to ftp sites. Please note that
it is preferable for you to use the symbolic name, rather than
the IP address given in brackets, because that address is much
more subject to change.
The official distribution site for the gnuplot source is
ftp.dartmouth.edu [129.170.16.4, soon to be 129.170.8.11],
the file is called /pub/gnuplot/gnuplot3.5.tar.Z. Official
mirrors of that distribution are (for Australia)
ftp.monash.edu.au [130.194.11.18] and (for Europe)
irisa.irisa.fr [131.254.254.2]. You can also get it from your
friendly neighbourhood comp.sources.misc archive.
MS-DOS and MS-Windows binaries are available from
+ oak.oakland.edu (North America) [141.210.10.117] as
/Simtel/msdos/plot/gpt35*.zip,
+ garbo.uwasa.fi (Europe) [193.166.120.5] as
/pc/plot/gpt35*.zip and
+ archie.au (Australia) [139.130.4.6] as
micros/pc/oak/plot/gpt35*.zip.
The files are: gpt35doc.zip, gpt35exe.zip, gpt35src.zip and
gpt35win.zip.
There is a special MS-DOS version for 386 or better processors;
it is available from the official gnuplot sites as DOS34.zip.
OS/2 2.x binaries are at ftp-os2.nmsu.edu [128.123.35.151],
in /os2/2.x/unix/gnuplt35.zip.
Amiga sources and binaries are available from ftp.wustl.edu
[128.252.135.4] as /pub/aminet/util/gnu/gnuplot-3.5.lha; there
are numerous mirrors of this distribution, for example
ftp.uni-kl.de, oes.orst.edu or ftp.luth.se.
The NeXTSTEP front end can be found at
ftp://next-ftp.peak.org/pub/next/binaries/plotting/ as
Gnuplot1.2_bin.tar.Z.
A version for OS-9/68K can be found at cabrales.cs.wisc.edu
[128.105.36.20] as /pub/OSK/GRAPHICS/gnuplot32x.tar.Z; it
includes both X-Windows and non - X-windows versions.
There is a version for the Macintosh at
ftp://ftp.ee.gatech.edu/pub/mac/gnuplot/ which includes
binaries for 68000-based Macs with and without FPU and native
support for PowerMacs.
Versions for the Atari ST and TT, which include some GEM
windowing support, are available from
ftp://ftp.uni-kl.de/pub/atari/graphics/, as gplt35st.zip
and gplt35tt.zip. They work best under MiNT.
Executable files, plus documentation in Japanese, exist for the
X680x0 on
ftp://ftp.csis.oita-u.ac.jp/pub/x68k/fj.binaries.x68000/vol
2.
People without ftp access can use an ftp-mail server; send a
message saying 'help' to bitftp@pucc.bitnet (for BITNET only)
or to ftpmail@ftp.dartmouth.edu.
For a uuencoded copy of the the gnuplot sources (compressed tar
file), send this as the body of a message to
ftpmail@ftp.dartmouth.edu:
open
cd pub/gnuplot
mode binary
get gnuplot3.5.tar.Z
quit
If you have some problem, you might need to stick
reply-to <your-email-address-here>
before all the above.
It is a good idea to look for a nearby ftp site when
downloading things. You can use archie for this. See if an
archie client is installed at your system (by simply typing
archie at the command prompt), or send mail to archie@sura.net
with the word 'help' in both the subject line and the body of
the mail. However, be aware that the version you find at a near
ftp site may well be out of date; check the last modification
date and the number of bytes against the newest release at one
of the official servers.
You can obtain a beta release of gnuplot 3.6 from
ftp://cmpc1.phys.soton.ac.uk/pub/.
Q2.3: How do I get gnuplot to compile on my system?
As you would any other installation. Read the files README and
README.Install, edit the Makefile according to taste, and run
make or whatever is suitable for your operating system.
If you get a complaint about a missing file libplot.a or
something similar when building gnuplot for X11, remove
-DUNIXPLOT from the TERMFLAGS= line, remove -lplot from the
DTBS= line and run again. If you are making X11 on a sun, type
'make x11_sun'.
For compiling gnuplot under Irix 5.2 and Irix 5.3, there is a
patch in the file lvs.zip in the contrib directory at
ftp.dartmouth.edu.
Q2.4: What documentation is there, and how do I get it?
The documentation is included in the source distribution. Look
at the docs subdirectory, where you'll find
+ a Unix man page, which says how to start gnuplot
+ a help file, which also can be printed as a manual
+ a tutorial on using gnuplot with LaTeX
+ a quick reference summary sheet for TeX only
PostScript copies of the documentation can be ftp'd from
ftp.dartmouth.edu, in pub/gnuplot, as manual.ps.Z and
tutorial.ps.Z
Andy Liaw and Dick Crawford have written a 16-page user's
guide. It is available from
ftp://picard.tamu.edu/pub/gnuplot/ as gptug.tex (also get
example.tex from the same directory), gptug.dvi or gptug.ps.
At the same site, there's a two- page instruction sheet for the
enhpost PostScript driver (see Q4.6 ) as enhpost.guide.ps
and a short guide to gnuplot PostScript files, as gp-ps.doc.
A Chinese translation of the gnuplot manual can be found on
ftp://servers.nctu.edu.tw/misc/environment/NCTU_EV/classnot
e/gnuplot.ps.gz .
There is a WWW hompepage for gnuplot at
http://www.cs.dartmouth.edu/gnuplot_info.html, which
includes the reference manual and a demo.
There are two more Chinese documents about gnuplot: a 72 - page
User's guide
ftp://phi.sinica.edu.tw/pub/aspac/doc/94/94002.ps.gz and a
28 - page Touring Guide
ftp://phi.sinica.edu.tw/pub/aspac/doc/95/95006.ps.gz. Both
documents are in PostScript format and gzipped.
Section 3: Working with it
Q3.1: How do I get help?
Give the 'help' command at the initial prompt. After that, keep
looking through the keywords. Good starting points are 'plot'
and 'set'.
Read the manual, if you have it.
Look through the demo subdirectory; it should give you some
ideas.
Ask your colleagues, the system administrator or the person who
set up gnuplot.
Post a question to comp.graphics.apps.gnuplot or send mail
to the gatewayed mailing list info-gnuplot@dartmouth.edu. If
you want to subscribe to the mailing list, send a mail to
majordomo@dartmouth.edu with the body of the message being
'subscribe info-gnuplot'. Please don't do this if you can get
comp.graphics.apps.gnuplot directly. If you pose a
question there, it is considered good form to solicit e-mail
replies and post a summary.
Q3.2: How do I print out my graphs?
The kind of output produced is determined by the 'set terminal'
command; for example, 'set terminal postscript' will produce
the graph in PostScript format. Output can be redirected using
the 'set output' command.
As an example, the following prints out a graph of sin(x) on a
Unix machine running the X Window system.
gnuplot> plot [-6:6] sin(x)
gnuplot> set terminal postscript
Terminal type set to 'postscript'
Options are 'landscape monochrome "Courier" 14'
gnuplot> set output "sin.ps"
gnuplot> replot
gnuplot> set output # set output back to default
gnuplot> set terminal x11 # ditto for terminal type
gnuplot> ! lp -ops sin.ps # print PS File (site dependent)
request id is lprint-3433 (standard input)
lp: printed file sin.ps on fg20.rz.uni-karlsruhe.de (5068 Byte)
!
gnuplot>
Q3.3: How do I include my graphs in <word processor>?
Basically, you save your plot to a file in a format your word
processor can understand (using "set term" and "set output",
see above), and then you read in the plot from your word
processor.
Details depend on the kind of word processor you use; use "set
term" to get a list of available file formats.
Many word processors can use Encapsulated PostScript for
graphs. This can be generated by the "set terminal postscript
eps" command. Most MS-DOS word processors understand HPGL
(terminal type hpgl).
With TeX, it depends on what you use to print your dvi files.
If you use dvips or dvi2ps, you can use Encapsulated
PostScript. For emTeX (popular for MS-DOS), you can use emTeX,
otherwise use the LaTeX terminal type, which generates a
picture environment.
If nothing else helps, try using the pgm or ppm format and
converting it to a bitmap format your favourite word processor
can understand. An invaluable tool for this is Jef Poskanzer's
PBMPLUS package.
The PBMPLUS package is available in the contrib distribution
for the X Window System. The original site for this is
ftp://ftp.x.org/contrib/. There are many mirrors, e.g.
ftp://ftp.th-darmstadt.de/pub/X11/contrib/ or .
ftp://sunsite.unc.edu/pub/X11/contrib/.
The most recent release of pbm by the author is dated December
91 and is called pbmplus10dec91.tar.Z
There is new version including lots of patches from the net
that is not maintained by the author called netpbm, with the
newest version called netpbm-7dec1993.tar.gz.
Check archie (see Q2.2 ) for an archive site near you.
Q3.4: How do I post-process a gnuplot graph?
This depends on the terminal type you use.
You can use the terminal type fig (you may need to recompile
gnuplot to enable this terminal type, by putting #define FIG
into <term.h>), and use the xfig drawing program to edit the
plot afterwards.
For PostScript output, you may be able to use the pstotgif
script (which calls GhostScript) to convert PostScript into the
format of the tgif drawing program. Tgif is also able to save
in PostScript format.
Both tgif and xfig can be obtained from the X Window contrib
distribution (see Q3.3).
Another possibility for modifying PostScript output appears to
be IslandDraw, a commercial drawing program for UNIX
workstations.
For Windows, there is another alternative, PageDraw. It can
post-process AI (Adobe Illustrator) files, and has a converter
from PostScript to AI. It can be downloaded from
http://www.wix.com/PageDraw/.
Q3.5: How do I change symbol size, line thickness and the like?
Again, this depends on the terminal type. For PostScript, you
can edit the generated PostScript file. An overview of what
means what in the PostScript files gnuplot generates can be
found at ftp://picard.tamu.edu/pub/gnuplot/ as gs-ps.doc.
A general introduction to PostScript can be found at
ftp://unix.hensa.ac.uk/pub/misc/ukc.reports/comp.sci/repor
ts/ as 11-92.ps.Z.
Q3.6: How do I generate plots in GIF format?
In gnuplot version 3.5, use the pbm terminal and use the
PBMPLUS package or other utilities to convert the resulting
bitmap (see Q 3.3 for how to get the PBMPLUS package).
In 3.6, there will be a gif terminal.
Section 4: Wanted features
Q4.0: What's new in gnuplot 3.6?
Here's the WhatsNew file of the current beta release,
patchlevel 319.
What's new in 3.6 ?
see version.c for a detailed list of recent changes
BUGS outstanding
minor tics missing on HPUX ?
problem with time on os/2 - optimiser bug ?
sometimes hidden-line-removal throws up a logic error (now fixed ?)
bounding box in pslatex (now fixed ? - please check)
terminal settings get propagated when terminal is changed (now fixed ?)
set ?range [] writeback is broken ? certainly for logscales.
source file copyrights are out of date - what should go on new files ?
to be documented - ms-windows cannot do wide, dashed lines (well, win32 can, but...)
does not build on win16 or sun/cc (getting closer)
OTHER ISSUES
set mapping spherical is not 'real' spherical polars
terminals are no longer allowed to do their own scaling
break up some of the drivers (eg epson and family) into their
own files. *maybe* we can provide libraries of generic routines
(particularly tex) which can be used by all interested drivers,
and because they are a library, they are linked only if
any relevant drivers are installed. bitmap.c could also be
linked in this way.
Now that all drivers are new format, do we need to explore separate
compilation of the drivers into their own .obj files for DOS ?
hidden line is SLOW, and throws up some logic errors
have I got all os/2 and (in particular) mac changes ?
filled boxes ?
substution using backquotes should not have a length limit
the source indentation stinks - may I pass it through gnu indent,
or will that mess up use of patches which did not make it into
the release.
As always, there are outstanding contributed patches
that I haven't yet installed (sorry), and half-promises for features
that I've not had a chance to fulfill.
in this release
suppress ! after a ! command in interactive mode
address polar mode, but polar grid looks wrong..?
314
misc bug fixes
310
HBB's hidden3d fix
latest gnuplot.doc and term/*.trm help sections
configure --with-gnu-readline[=path]
in 309
sorry Roger ; os2 keeps on improving, but I forget to announce it
{and often incorporate it !}
relative errors displayed in fit
in 306
histeps style
LINE WIDTH PATCH ! {but many structures passed by value ?}
tolerate missing closing backquote at end of line
no limit on output filename
set key samplelen / spacing
plot ... axis alias for plot ... axes
Thomas Koenig's postscript test for reencoding on the fly [at last]
multiplot clear for djsvga
size option on gif driver
in 300
FINALLY moved the axes syntax over to plot ... axes x1y1 ...
3d fitting ; FIT_INDEX no longer supported/needed (see fit.dem)
added data columns -1 for line and -2 for index, for 3d fit
had another go at the VPATH stuff for configure / make
in 297
back out unwanted feature of basing tics on relative size/font
add financebars / candlesticks - size controlled by set bar
plot 'file' using 0:1 gives x=0,1,... as gnuplot 3.5
optional keyword 'font' in set xlabel 'text' dx,dy [font] "font,size"
fix undefined points in splines
in 293/294
ICCCM export of the x-window (allow paste into compliant apps ie NTRIGUE)
print "string", expression, "string", ...
set size square has been generalised to
set size { square | ratio <r> | noratio }
where <r> is an aspect ratio of height / width
(at last) Hans-Bernhard Br"oker's changes, including fit fix and
new hidden line removal routine
plot line is commited to replot line at last possible moment, so
that typos in complex plot do not ruin everything
time routines separated into time.c - option to use system time
routines instead of the gnuplot ones. Undocumented command
testtime 'format' 'string' to assist testing of time routines
small changes to the terminal handling : hide details in term.c
new shared makefile strategy : makefile.all
in 273
pslatex driver takes solid/dashed
cgm driver (ms-office applications ?)
accept using ::4 as shorthand for using 1:2:4
accept lp as abbreviation of linesp
in 268
asinh() etc
gnuplot -persist and set term x11 [reset] <n>
gif terminal driver [not new in this release, but not mentioned before]
in 261
compile on windows NT
/end and /noend options in windows gnuplot
first attempt at timecolumn() and tm_sec() family of functions
splot 'file' matrix
in 248 (?)
try *again* to fix the postscript bounding box
ALL TERMINALS UPDATED (thanks Stefan !)
Continue to move help out of gnuplot.doc into terminal driver files (thanks Joerg)
address problems with splines in log scales - NOTE that we take logs
and then fit splines
%T in gprintf prints as %d not %f hence no trailing .0000
set locale only affects LC_TIME (for the moment ?)
make start optional in series tics, ie accept
set [xyz]tics {start,}step{,end}
also, if start or end not specified, treat as computed, and autoextend
plot to a multiple of tics
in 242
allow negative ticslevel
geometric series tics for logscale
enhanced sprintf format for tics - extra format characters available
%x %o %e %f %g %t %T %l %L %s %S %c
take plot size and driver into account when choosing tics
accept x1y2 etc in place of first/second
extra line in boxed key
x2 label
fonts for label
strftime format for 'set time'
more timeseries patches
set locale
try to fix postscript bounding box
in 224
set clabel ['format']
pstexdriver
set encoding
enhpost moved into post.trm
index a:b:c for splot
in 194
multiplot for splot
in 188
os9 port
set xrange [] reverse writeback
allow mix of co-ordinate systems within an arrow/label posn
initial multiplot support
- doesn't yet check that terminal is capable, but there is a
flags field added to the terminal entry to tell gnuplot about this.
also, suspend() / resume() entry points which are to be called
between plots of a multiplot.
in 178
arbitrary length/number of columns in datafile
accept double/quad-precision fortran numbers (1.23{dDqQ}4)
- but not in scanf format string
undefined fit parameters start at 1 rather than 1e-30
- more chance of convergence / less change of unitary matrix
WIN32 / Win-NT support
table output can be read back in for data splot
- hence gnuplot can be used to dgrid a datafile and write it out
set missing 'string'
- nominate a token as standing for missing values in datafile
- not yet added to documentation
updates to time-series stuff (so it doesn't break at 2000)
- except it has become horribly non-portable :-(
split graph3d.c into util3d.c and hidden3d.c
in 166
set bar <size>
- a number rather than just small or large
allow different linetypes for grid at major and minor tics
a few more set no* commands for consistency.
initial go at implementing tic mirrors and axes for splot
- no ztic axis yet (or no zzeroaxis)
- tics on axes are not hidden by surface
attempt to make sin(x) behave as expected when set angle degrees
- gives answers if x is complex, but I dont know if they are correct
- acos(cos(x)) seems to give x, so at least its consistent
- fix a bug which made acos(cos({0,1})) undefined
new grass.trm
in release 162/164
set size [{no}square] x,y - tries to plot with aspect ratio 1
- seems to work great for postscript
- please check with your favourite driver
- uses relative sizes of tics to determine required size.
posn for key, labels and arrows can be in one of 4 co-ordinate systems
- first_axes (default)
- second_axes (for plot..second)
- graph (0,0 -> 1,1 = plotting area)
- screen (0,0 -> 1,1 = whole screen)
- arrows needn't have endpoints in same co-ords. see help set label
via is now a required keyword for fit
- fit f(x) 'file' ... via { 'file' | a,b,... }
- this is to avoid confusing 'file' with 'using-format-string'
win32 and 16-bit dos fixes
- I can compile with tc++, but get an overlay error at runtime.
new set of documentation programs (I haven't tried them)
various tweaks to makefile
changes to pslatex
- substitute .ps at _last_ . in filename
- accept font size of enclosing document as an option.
- dont forget to close aux file
in release 151
linux security patch
can specify font for labels, etc (postscript only ? - I haven't tried this)
can specify linetype to draw grid / zeroaxes / arrows
emx terminal driver
first attempt at pipes for VMS and vector style - needs more work
l/b/r/t-margin in place of xmargin - more control over size of margins
incompatible changes to polar mode:
- t is now the dummy variable, so x is width of plot as expected
- tics are not automatically on axes - set {xy}tics axis nomirror
- grid is not automatically polar - set grid x [mx] polar [angle]
- no numbers on grid - they were always in degrees
second axes
- x2 and y2 are an independent pair of axes, but they inherit
ranges from x and y if no second data
- there can be problems with this, actually - if x2tics are not
shown, x2range is not autoextended to whole number of tics, so
same data might not have same range.
- set x2tics/y2tics/x2label/y2label
- set [no]log x2 / y2
- plot [first,] f(x), 'file', ..., second, g(x), ...
- get specify grid at any/all of x,y,x2,y2
- see electron.dem
set border <mask> - 12 bit binary number selects 12 sides of cube around splot
can specify grid z, to get a grid on back wall of splot
set mxtics [<interval>|default] | set nomxtics
- set mxtics gives auto for logscale, fixed for linear
binary, index and every keywords to datafiles.
- every also works with binary files
can use '-' as datafile for inline data (ends at line with e)
can use '' to mean reuse previous file
splot and fit now use datafile module
- FIT_SKIP no longer supported - use fit f(x) 'file' every n
can limit fit range using fit [variable=min:max] f(variable) ...
set ticscale <major> [<minor>]
surface is clipped with no hidden line removal
- still to do contour and hidden-line surface
set {x|y|x2|y2} [axis|border] [no]mirror
- can put tics on border or axes
- mirror controls mirroring of tics on opposite axis
- no longer coupled to set tics out setiing.
No longer need to specify parametric mode for 3-column data files.
ranges automatically extended to whole number of tic intervals
- doesn't always manage to drop vertical from surface to corner of base
- workaround is either specify range or use set border
patchlevel 140
--------------
I've probably missed a lot of features since I'm so used to them.
Plus I never bothered with 3.5 so some of these may have been there.
some of these may have made it into the documentation
Here goes:
fit f(x) 'file' via ...
read and plot time data (timedat.dem)
set key [top|bottom|under] [left|right|out] [reverse] [box [<linetype>]]
set key title 'text'
Processing of escape sequences in "strings" but not 'strings'
- TeX users in particular advised to use ''
Multiline labels, etc, using "first\nsecond"
enhpost driver
call command (load with parameters)
x error bars. splines. boxes. [some may have been in 3.5]
pipes for amiga
the using patch plot 'file' using spec:spec:...
- spec is either column number or (expression in $1, $2, ...)
new pslatex driver with postscript to aux file.
set pointsize <scale factor> on some terminals
doubles in plot...using format string - %lf
unlimited input line length and expression (action) table
minor tic-marks (like logscale but also for linear)
- also set grid [mx|my]
that's all I can think of for the moment...
Q4.1: Does gnuplot have hidden line removal?
Version 3.5 supports hidden line removal on all platforms
except MS-DOS; use the command
set hidden3d
If someone can solve the 64K DGROUP memory problem, gnuplot would
support hidden line removal on MS-DOS as well. Version 3.2
supports limited hidden line removal.
Q4.2: Does gnuplot support bar-charts/histograms/boxes?
As of version 3.4, it does; use the style "with boxes" for bar
charts. To get filled boxes, you can try a modification by
Steve Cumming, available via ftp from
ftp://grebe.geog.ubc.ca/pub/gnuplot as box.tar.
Q4.3: Does gnuplot support multiple y-axes on a single plot?
Yes, with two unofficial mods, multiplot.shar and borders.shar.
They can be obtained from
ftp://ftp.dartmouth.edu/pub/gnuplot/contrib/multi_woo.zip
or ftp://ftp.cygnus.edu/incoming/gpx38.zip.
Also, 3.6 supports this capability.
Q4.4: Can I put multiple plots on a single page?
Yes, with the multiplot.shar mod, or if you are running gnuplot
3.6. If you are using PostScript output, check out mpage, which
can be ftp'd from ftp.eng.umd.edu:pub/misc/mpage-2.tar.Z
Q4.5: Can I put both data files and commands into a single file?
This feature is in gnuplot 3.6.
Q4.6: Can I put Greek letters and super/subscripts into my labels?
You might try using the LaTeX terminal type and putting text
like \alpha_{3} into it.
David Denholm has written a PostScript terminal which allows
for super/and subscripts, such as a^x or {/Symbol a }. Ftp to
sotona.phys.soton.ac.uk [152.78.192.42] and get enhpost.trm,
written by David Denholm and Matt Heffron. To install it,
follow the instructions at the top of the file, then recompile.
enhpost is also included in gnuplot 3.6.
Q4.7: Can I do 1:1 scaling of axes?
Not easily in 3.5; in 3.6, you can use "set size square".
Q4.8: Can I put tic marks for x and y axes into 3d plots?
In version 3.5, you can; use the "with boxes" option.
Q4.9: Does gnuplot support a driver for <graphics format>?
To see a list of the available graphic drivers for your
installation of gnuplot, type "set term".
Some graphics drivers are included in the normal distribution,
but are uncommented by default. If you want to use them, you'll
have to change ~gnuplot/term.h, and recompile.
Q4.10: Can I put different text sizes into my plots?
If you use PostScript output, you can use Dave Denholm's and
Matt Heffron's updated PostScript driver,
/sotona.phys.soton.ac.uk:/enhpost.trm (see also Q4.6 ).
Else, use 3.6.
Q4.11 How do I modify gnuplot, and apply 'patches'?
For this, you will need to recompile gnuplot.
Modifications people make are either done by replacing files,
such as terminal drivers, or by 'patching'. If a file is a
replacement, it will probably tell you in its README or in the
lines at the beginning.
To patch a file, you need Larry Wall's patch utility. On many
UNIX systems, it is already installed; do a man patch to check.
If it isn't, you'll have to get it; it can be found wherever
GNU software is archived.
Q4.12 How do I skip data points?
By specifying ? as a data value, as in
1 2
2 3
3 ?
4 5
Q4.13 How do I plot every nth point?
You can apply the patch point_skip from the contrib section
(see Q5.3 or, assuming you have awk installed on your
system, you can use the following line:
gnuplot> plot "< awk '{if(NR%5==0)print}' file.dat"
plots every 5th line, and
gnuplot> plot "< awk '$0 !~ /^#/ {if(NR%40==0)print $1, $4}' file.dat"
plots every 40th line while skipping commented lines.
Section 5: Miscellaneous
Q5.1: I've found a bug, what do I do?
First, try to see whether it actually is a bug, or whether it
is a feature which may be turned off by some obscure set -
command.
Next, see wether you have an old version of gnuplot; if you do,
chances are the bug has been fixed in a newer release.
If, after checking these things, you still are convinced that
there is a bug, proceed as follows. If you have a fairly
general sort of bug report, posting to
comp.graphics.apps.gnuplot is probably the way to go. If
you have investigated a problem in detail, especially if you
have a context diff that fixes the problem, please e-email a
report to bug-gnuplot@dartmouth.edu. The bug-gnuplot list is
for reporting and collecting bug fixes, the
comp.graphics.apps.gnuplot newsgroup will be more help for
finding work arounds or actually solving gnuplot related
problems. If you do send in a bug report, be sure and include
the version of gnuplot (including patchlevel), terminal driver,
operating system, an exact description of the bug and input
which can reproduce the bug. Also, any context diffs should be
referenced against the latest official version of gnuplot if at
all possible.
Q5.2: Can I use gnuplot routines for my own programs?
Yes. John Campbell <jdc@nauvax.ucc.nau.edu> has written
gplotlib, a version of gnuplot as C subroutines callable from a
C program. This is available as gplotlib.tar.Z on the machine
ftp.nau.edu in the directory /pub/gplotlib.tar.Z. This library
has been updated to be compatible with version 3.5.
Q5.3: What extensions have people made to gnuplot? Where can I get
them?
__Extensions are available from
ftp://ftp.dartmouth.edu/pub/gnuplot/contrib/ . It contains
the following files:
Point Skips
+ _Data Filtering_ Instead of just having two params
following the style param, there are now 4:
o 1: line_type
o 2: point_type
o 3: point_skip - gives the number of data samples per
plotted point
o 4: point_offs - gives the sample number on which to plot
the first point
Thus points are plotted only for the samples n satisfying n =
point_skip*i + point_offs for some non-negative integer i.
From:
pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu
(Michael Clark)
+ _Point Skip with Awk_ With UNIX,
gnuplot> plot "< awk '{if(NR%5==0)print$0}' file.dat"
From: James Darrell McCauley, mccauley@ecn.purdue.edu
+ _New Xlib mods._ From: gregg hanna
(gregor@kafka.saic.com)
Vectors and Arrows
+ _Program to convert lines to vectors_ This program turns
line segments into line segments with a half-arrow at the
head: by uncommenting two lines below, the arrowhead will be
a triangle. optional arguments: size angle where size is a
fraction of each vector's magnitude and angle is in degrees
all data taken from standard input, and output to standard
output. typical invocation:
arrow 0.2 15 <vector.lin >vector.heads
From: andrew@jarthur.claremont.edu (Andrew M. Ross)
+ _Vect2gp_, an awk script to make gnuplot command script
to draw a vector field map. From: hiro@ice3.ori.u-tokyo.ac.jp
(Yasu-Hiro YAMAZAKI)
+ _GNUPLOT to SIPP_ This is a "far from perfect" converter
that takes gnuplot table output and splits it in polygons.
Then it calls sipp to render it. You get sipp from
isy.liu.se:/pub/sipp or ask archie. From:
chammer@POST.uni-bielefeld.de (Carsten Hammer)
Histograms and Pie Charts
+ _Histogram C program_ The short C program below is a
filter that calculates a histogram from a sequence of numbers
and prints the output in such a format that Gnuplot can plot
the histogram by the command sequence
!histogram < datain > tmp;
plot "tmp" with impulses
From: mustafa@seas.smu.edu (Mustafa Kocaturk)
+ _HG_ is an automatic histogram generator. it reads a
column of data from an input file and emits a [log] histogram
ks does ks or chi^2 tests on a set of input arrays. you need
the "numerical recipes in C" library somewhere on your system
to link this one. I can not undertake to fix bugs or add
features, but I might do it if asked. From: Steve Cumming
stevec@geog.ubc.ca
+ _Piechart C program_ The short C program below formats
data for display as a piechart. From: mccauley@ecn.purdue.edu
(James Darrell McCauley)
Interprocess Communications
+ _Notes of Windows Hooks_ From: Maurice
Castro,maurice@bruce.cs.monash.edu.au
+ _Named Pipes Example _From:
dtaber@deathstar.risc.rockwell.com (Don Taber)
+ _PipeLib_ What the library does is set up to 20 programs
going (like gnuplot), then allows you to send to them as if
the program were typing on the command line. I've included a
brief set of docs after the source code, in latex format.
There is no facility to watch the output of a program. From:
ssclift@neumann.uwaterloo.ca (Simon Clift)
+ _Popen example from lsqrfit_ The following function
sends a command to gnuplot. Gnuplot will execute the command
just as if you typed it at the gnuplot command line. This
example is adapted from my least squares fitting program
which is located at ftp.cdrom.com in
pub/os2/2_x/unix/lsqrft14.zip. Complete source is included.
From: michael@krypton.mit.edu (Michael Courtney)
Multiple logical plots on a single page
+ _Gawk script for multiple encapsulated postscript on a
page_ It's slightly more flexible than mpage, because it
changes the aspect ratio of the plots; mpage according to the
documentation only allows 1, 2, 4, or 8 plots on a page. This
script works for unix with encapsulated postscript (eps)
output. It should work with gawk or nawk, although I've only
tested it with gawk. (Gawk is GNU's version of awk and is
available from prep.ai.mit.edu.) You just specify how many
rows and columns of plots you want and it does the rest. For
example, gnuplot_eps rows=3 cols=2 *.eps | lpr will print all
eps files in your current directory with 6 on a page. Also,
see the comments in the file. From:
holt@goethe.cns.caltech.edu (Gary Holt)
+ _Sed script for multiple encapsulated postscript on a
page_ You have MULTIPLE postscript files each containing a
single plot. From: wgchoe@scoupe.postech.ac.kr (Choe Won Gyu)
+ _Massive patch_ with add multiplotcapability to all
devices and a lot more. The reason it is offered in this form
is because the original multiplot.pat did not patch correctly
into gnuplot version 3.5. This mod also add borders options,
financial plots, multiple line titles and other asundry
items. Use at your own risk. Look at the top of makefile.r
for a more complete list of changes.
From: Alex Woo, woo@playfair.stanford.edu
lvs.zip
This contains miscellaneous, modifications, which include:
+ Label positioning using either plot or device-relative
coodinates
+ Portability to Irix-5.2 and Irix-5.3
+ The "thru" keyword has been extended to include "thrux" for
the X - Coordinate
+ Capability to read a ordinary Fortran-style unformatted file
+ A Perl script for better handling of eps
+ Modifications to docs/doc2info to generate "next", "prev",
and "up" data for each node.
+ Changes in the documentation to reflect the above.
Miscellaneous Mods
+ _Congp3d3_ is a preprocessor to draw contour plots on
irregular regions. From: mrb2@nrc.gov (Margaret Rose Byrne)
+ _Sockpipe_ is a socket based pipe needed for the
Stardent OS. From: Mike Hallesy, Stardent Computer Product
Support, hal@stardent.com
+ _Time Series_ is a patch to add multiline titles and
labels, time series x and y data and tic marks, and automatic
resizing of plots and much more. From: Hans Olav Eggestad,
olav@jordforsk.nlh.no
Other Operationing Systems
+ _MacIntosh Port of Version 3.2_ From: Noboru Yamamoto,
sun!kekvax.kek.jp!YAMAMOTO@pixar.com
+ _MacIntosh Port of Version 3.5_ From:
laval@londres.cma.fr (Philippe LAVAL)
+ _OS-9 Port of Version 3.2_
Q5.4: Can I do heavy - duty data processing with gnuplot?
Gnuplot alone is not suited very well for this. One thing you
might try is fudgit, an interactive multi-purpose fitting
program written by Martin-D. Lacasse
(isaac@frodo.physics.mcgill.ca). It can use gnuplot as its
graphics back end and is available from ftp.physics.mcgill.ca
in /pub/Fudgit/fudgit_2.33.tar.Z [132.206.9.13], and from the
main Linux server, tsx-11.mit.edu [18.172.1.2] and its numerous
mirrors around the world as
/pub/linux/sources/usr.bin/fudgit-2.33.tar.z. Versions are
available for AIX, Data General, HP-UX, IRIX 4, Linux, NeXT,
Sun3, Sun4, Ultrix, OS/2 and MS-DOS. The MS-DOS version is
available on simtel20 mirrors (simtel20 itself has closed down)
in the "math" subdirectory as fudg_231.zip.
Carsten Grammes has written a fitting program which goes
together with gnuplot; it is called gnufit and is available
from the official gnuplot sites, as the files gnufit12.info,
gnufit12.tar.gz (source) and gft12dos.zip (MS-DOS). It has been
merged into gnuplot 3.6.
Michael Courtney has written a program called lsqrft, which
uses the Levenberg - Marquardt - Algorithm for fitting data to
a function. It is avialiable from ftp.cdrom.com as
/pub/os2/2_x/unix/lsqrft13.zip; sources, which should compile
on Unix, and executables for MS-DOS and OS/2 2.x are included.
There is an interface to the OS/2 presentation manager.
You might also want to look at the applications developed by
the Software Tools Group (STG) at the National Center for
Supercomputing Applications. Ftp to ftp.ncsa.uiuc.edu
[141.142.20.50] and get the file README.BROCHURE for more
information.
You can also try pgperl, an integration of the PGPLOT plotting
package with Perl 5. Information can be found at
http://www.ast.cam.ac.uk/~kgb/pgperl.html, the source is
available from ftp://ftp.ast.cam.ac.uk/pub/kgb/pgperl/ or
ftp://linux.nrao.edu/pub/packages/pgperl/.
Another possibility is Octave. To quote from its README: Octave
is a high-level language, primarily intended for numerical
computations. It provides a convenient command line interface
for solving linear and nonlinear problems numerically.
The latest released version of Octave is always available via
anonymous ftp from bevo.che.wisc.edu in the directory
/pub/octave.
Q5.5: I have ported gnuplot to another system, or patched it. What do
I do?
If your patch is small, mail it to bug-gnuplot@dartmouth.edu,
with a thorough description of what the patch is supposed to
do, which version of gnuplot it is relative to, etc. Also, you
can send notification of the patch to the FAQ maintainer, if
you want a mention. Please don't send the patch itself to me
:-)
If your modifications are extensive (such as a port to another
system), upload your modifications to
ftp://ftp.dartmouth.edu/pub/dropoff. Please drop a note to
David.Kotz@dartmouth.edu, the maintainer of the gnuplot
subdirectory there, plus a note to bug-gnuplot@dartmouth.edu.
Q5.6: I want to help in developing gnuplot 3.6. What can I do?
Join the gnuplot beta test mailing list by sending a mail
containing the line
subscribe info-gnuplot-beta
in the body (not the subject) of the mail to Majordomo@Dartmouth.EDU.
Section 6: Making life easier
Q6.1: How do I plot two functions in non - overlapping regions?
Use a parametric plot. An example:
set parametric
a=1
b=3
c=2
d=4
x1(t) = a+(b-a)*t
x2(t) = c+(d-c)*t
f1(x) = sin(x)
f2(x) = x**2/8
plot [t=0:1] x1(t),f1(x1(t)) title "f1", x2(t), f2(x2(t)) title "f2"
Q6.2: How do I run my data through a filter before plotting?
If your system supports the popen() function, as Unix does, you
should be able to run the output through another process, for
example a short awk program, such as
gnuplot> plot "< awk ' { print $1, $3/$2 } ' file.in"
Unfortunately, in 3.2, there is a rather short limitation on the
maximum argument length, so your command line may be truncated
(usually, this will mean that awk cannot find the filename).
Also, you may need to escape the $ - characters in your awk
programs.
As of version 3.4, gnuplot includes the thru - keyword for the
plot command for running data files through a gnuplot - defined
function.
You can also get divhack.patch from
sotona.phys.soton.ac.uk[152.78.192.42] via anonymous ftp. It
allows expressions of the kind
gnuplot> plot "datafile" using A:B:C
where A,B,C,... are now either a column number, as usual, or an
arbitrary expression enclosed in ()'s, and using $1,$2,etc to
access the data columns.
Q6.3: How do I make it easier to use gnuplot with LaTeX?
There is a set of LaTeX macros and shell scripts that are meant
to make your life easier when using gnuplot with LaTeX. This
package can be found on ftp.dartmouth.edu [129.170.16.54, soon
to be 129.170.8.11] in pub/gnuplot/latex.shar, by David Kotz.
For example, the program "plotskel" can turn a gnuplot-output
file plot.tex into a skeleton file skel.tex, that has the same
size as the original plot but contains no graph. With the right
macros, the skeleton can be used for preliminary LaTeX passes,
reserving the full graph for later passes, saving tremendous
amounts of time.
Q6.4: How do I save and restore my settings?
Use the "save" and "load" commands for this; see "help save"
and "help load" for details.
Q6.5: How do I plot lines (not grids) using splot?
If the data in a data file for splot is arranged in such a way
that each one has the same number of data points (using blank
lines as delimiters, as usual), splot will plot the data with a
grid. If you want to plot just lines, use a different number of
data entries (you can do this by doubling the last data point,
for example). Don't forget to set parametric mode, of course.
Q6.6: How do I plot a function f(x,y) which is bounded by other
functions in the x-y plain?
An example:
f(x,y) = x**2 + y **2
x(u) = 3*u
yu(x) = x**2
yl(x) = -x**2
set parametric
set cont
splot [0:1] [0:1] u,yl(x(u))+(yu(x(u)) - yl(x(u)))*v,\
f(x(u), (yu(x(u)) - yl(x(u)))*v)
Q6.7: How do I get rid of <feature in a plot>?
Usually, there is a set command to do this; do a
gnuplot> ?set no
for a short overview.
Q6.8: How do I call gnuplot from my own programs?
Here's code which works for a UNIX system, using (efficient)
named pipes.
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#define PANIC(a) do { \
perror(a); \
if (temp_name) unlink(temp_name);\
exit(1);\
} while(0)
int main() {
FILE *command,*data;
char *temp_name = NULL;
double a,b;
int i;
if ((temp_name = tmpnam((char *) 0)) == 0) PANIC("tmpnam failed");
if(mkfifo(temp_name, S_IRUSR | S_IWUSR) != 0) PANIC("mkfifo failed");
command = popen("gnuplot","w");
fprintf(command,"plot \"%s\" with lines\n",temp_name); fflush(command);
data = fopen(temp_name,"w");
for (i=0; i<20; i++) {
a = i/10.0;
b = sin(a);
fprintf(data,"%f %f\n",a,b);
}
fclose(data);
fprintf(stderr,"press enter to continue..."); fflush(stderr);
getchar();
fprintf(command,"plot \"%s\" with lines\n",temp_name); fflush(command);
data = fopen(temp_name,"w");
for (i=0; i<20; i++) {
a = i/10.0;
b = cos(a);
fprintf(data,"%f %f\n",a,b);
}
fclose(data);
fprintf(stderr,"press enter to continue..."); fflush(stderr);
getchar();
pclose(command);
unlink(temp_name);
return 0;
}
Here's code for OS/2, again using named pipes; I'm unable to check
this out myself. This code is care of fearick@physci.uct.ac.za
(Roger Fearick).
#include <stdio.h>
#define INCL_DOS
#define INCL_DOSPROCESS
#define INCL_DOSNMPIPES
#include <os2.h>
main()
{
HPIPE hpipe ;
FILE *hfile, *hgnu ;
/* create a named pipe. Use NP_WAIT so that DosConnect...
blocks until client (gnuplot) opens, and client reads
are blocked until data is available */
DosCreateNPipe( "\\pipe\\gtemp",
&hpipe,
NP_ACCESS_OUTBOUND,
NP_WAIT|NP_TYPE_BYTE|1,
256,
256,
-1 ) ;
/* use stream i/o */
hfile = fdopen( hpipe, "w" ) ;
/* start gnuplot; use unbuffered writes so we don't need to
flush buffer after a command */
hgnu = popen( "gnuplot", "w" ) ;
setvbuf( hgnu, NULL, _IONBF, 0 ) ;
/* plot a set of data */
fprintf( hgnu, "plot '/pipe/gtemp'\n" ) ; /* issue plot command */
DosConnectNPipe( hpipe ) ; /* wait until 'file' opened */
fprintf( hfile, "1 1\n" ) ; /* write data to 'file' */
fprintf( hfile, "2 2\n" ) ;
fprintf( hfile, "3 3\n" ) ;
fprintf( hfile, "4 4\n" ) ;
fflush( hfile ) ; /* flush buffer forces read */
DosSleep( 500 ) ; /* allow gnuplot to catch up */
DosDisConnectNPipe( hpipe ) ; /* disconnect this session */
fprintf( hgnu, "pause -1\n" ) ; /* admire plot */
/* plot another set of data */
fprintf( hgnu, "plot '/pipe/gtemp'\n" ) ;
DosConnectNPipe( hpipe ) ;
fprintf( hfile, "1 4\n" ) ;
fprintf( hfile, "2 3\n" ) ;
fprintf( hfile, "3 2\n" ) ;
fprintf( hfile, "4 1\n" ) ;
fflush( hfile ) ;
DosSleep( 500 ) ;
DosDisConnectNPipe( hpipe ) ;
fprintf( hgnu, "pause -1\n" ) ;
DosClose( hpipe ) ;
pclose( hgnu ) ;
}
; The above code works for gnuplot 3.5. In gnuplot 3.6, this can be
greatly simplified, since data can be fed 'inline, as in
plot '-' w l
1 1
2 3
3 4
e
Section 7: Known problems
Q7.1: Gnuplot is not plotting any points under X11! How come?
Very probably, you still are using an old version of
gnuplot_x11. Remove that, then do a full installation.
On VMS, you need to make several symbols:
$ gnuplot_x11 :== $disk:[directory]gnuplot_x11
$ gnuplot :== $disk:[directory]gnuplot.exe
$ def/job GNUPLOT$HELP disk:[directory]gnuplot.hlb
Then run gnuplot from your command line, and use
gnuplot> set term x11
Q7.2: My isoline data generated by a Fortran program is not handled
correctly. What can I do?
One known cause for this is the use of list-directed output (as
in WRITE(10,*) for generating blank lines. Fortran uses ASA
carriage control characters, and for list - directed output
this results in a space being output before the newline.
Gnuplot does not like this. The solution is to generate blank
lines using formatted output, as in WRITE(10,'()'). If you use
carriage return files in VMS Fortran, you may have to open the
file with OPEN(...,CARRIAGECONTROL='DTST') or convert it using
the DECUS utility ATTRIB.EXE:
VMS> ATTRIB/RATTRIB=IMPDTED FOR010.DAT
Q7.3: Why does gnuplot ignore my very small numbers?
Gnuplot treats all numbers less than 1e-08 as zero, by default.
Thus, if you are trying to plot a collection of very small
numbers, they may be plotted as zero. Worse, if you're plotting
on a log scale, they will be off scale. Or, if the whole set of
numbers is "zero", your range may be considered empty:
gnuplot> plot 'test1'
Warning: empty y range [4.047e-19:3e-11], adjusting to [-1:1]
gnuplot> set yrange [4e-19:3e-11]
gnuplot> plot 'test1'
^
y range is less than `zero`
The solution is to change gnuplot's idea of "zero":
gnuplot> set zero 1e-20
For more information,
gnuplot> help set zero
Q7.4: Gnuplot is plotting nothing when run via gnuplot <filename>!
What can I do?
Put a pause -1 after the plot command in the file.
Q7.5: My formulas are giving me nonsense results! What's going on?
Gnuplot does integer, and not floating point, arithmetic on
integer expressions. For example, the expression 1/3 evaluates
to zero. If you want floating point expressions, supply
trailing dots for your floating point numbers. Example:
gnuplot> print 1/3
0
gnuplot> print 1./3.
0.333333
This way of evaluating integer expressions is shared by both C and
Fortran.
Q7.6: My Linux gnuplot complains about a missing gnuplot_x11. What is
wrong?
The binary gnuplot distribution from sunsite.unc.edu and its
mirrors in Linux/apps/math/gplotbin.tgz is missing one
executable that is necessary to access the x11 terminal. Please
install gnuplot from another Linux distribution, e.g.
Slackware.
Q7.7: set output 'filename' isn't outputting everything it should!
You need to flush the output with a closing 'set output'.
Section 8: Credits
This list was initially compiled by John Fletcher with contributions
from Russell Lang, John Campbell, David Kotz, Rob Cunningham, Daniel
Lewart and Alex Woo. Reworked by Thomas Koenig from a draft
by Alex Woo, with corrections and additions from Alex Woo, John
Campbell, Russell Lang, David Kotz and many corrections from Daniel
Lewart; Axel Eble and Jutta Zimmermann helped with the
conversion to HTML.
Thomas Koenig, ig25@rz.uni-karlsruhe.de, 1994-03-28
|