[BACK]Return to 0FAQ CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot

Annotation of OpenXM_contrib/gnuplot/0FAQ, Revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>