%% Don't forget to change the paper format in the next line
%
% $Id: faq.tex,v 1.1.1.1 2002/12/07 18:33:30 lhecking Exp $
%
%
\documentclass[a4paper,11pt]{article}
\usepackage{html}
\usepackage[hyphens,T1]{url}
\usepackage[T1]{fontenc}

\newcommand{\news}[1]%
	{\def~{\~{}}\htmladdnormallink{\latex{\url{#1}}\html{\texttt{#1}}}%
		{news:#1}%
	}
\newcommand{\ftp}[2]%
	{\htmladdnormallink{\latex{\url{#1}{} in \url{#2}}%
		    \html{\texttt{#1} in \texttt{#2}}}%
		{ftp://#1#2}%
	}
\newcommand{\mailto}[1]%
	{\htmladdnormallink{\latex{\url{<#1>}}\html{\texttt{#1}}}%
		{mailto:#1}%
	}
\newcommand{\http}[1]%
	{\htmladdnormallink{\latex{\url{http://#1}}%
		    \html{\texttt{http://#1}}}%
		{http://#1}%
	}

% comments and discussions:
% version 1.4 dated 99/10/07
% am: comment out obviously outdated stuff and wait for complaints
% jvh: re: I accept
% hbb: need expires and posting-frequency headers
% jvh: re: expires is ok, but I still post it manually so
%	I've got to see how I could get the posting frequency header
% am: shouldn't we have document release and date in the title
% jvh: re: I guess it would overload the title. I would
%	accept the inclusion into 0.1. I still hope that
%	the FAQ will experience a slightly lower release
%	cycle in the near future :)

%
\newcommand{\gnuplot}{\textbf{gnuplot}}
\newcommand{\Gnuplot}{\textbf{Gnuplot}}


\begin{document}
\title{\Gnuplot{} FAQ}
\author{}
\date{}
\maketitle

\tableofcontents

\setcounter{section}{-1}
\section{Meta -- Questions}
\subsection{Where do I get this document?}
This document is posted about once every two weeks to the newsgroups
\news{comp.graphics.apps.gnuplot}. Its newest
(plaintext) version is available via anonymous ftp from
\ftp{ftp.gnuplot.info}{/pub/gnuplot/faq/faq.txt}.

If you have access to the WWW, you can get the newest version of this
document from
\http{www.ucc.ie/gnuplot/faq.html}.

Today's version is 
version 
\verb+$Revision: 1.1.1.1 $+, dated
\verb+$Date: 2002/12/07 18:33:30 $+

\subsection{Where do I send comments about this document?}

Send comments, suggestions etc via email to the developer mailing list
\mailto{info-gnuplot-beta@Dartmouth.EDU}.

\section{General Information}

\subsection{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.

This document deals with \gnuplot{} Version 3.7 which is the
latest official release as of \today. References to bug-fix
versions or (recent) beta versions are explicitly marked.


\subsection{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:
\begin{quote}
     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.
\end{quote}


\subsection{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. It used to be distributed
by the FSF, however, due to licensing issues it is no longer.

\Gnuplot{} is freeware in the sense that you don't have to pay
for it. However it is not freeware in the sense that you would be
allowed to distribute a modified version of your \gnuplot{} freely.
Please read and accept the \texttt{Copyright} file in your distribution.

\subsection{What does \gnuplot{} offer?}

\begin{itemize}
\item Plotting of two-dimensional functions and data points in many
different styles (points, lines, error bars)
\item computations in integer, float and complex arithmetic
\item plotting of three-dimensional data points and surfaces in
many different styles (contour plot, mesh).
\item support for complex arithmetic
\item self - defined functions
\item support for a large number of operating systems, graphics
file formats and devices
\item extensive on-line help
\item labels for title, axes, data points
\item command line editing and history on most platforms
\end{itemize}

\subsection{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.

\subsection{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, BeOS, and the Macintosh.


Please notify the FAQ-maintainer of any further ports you
might be aware of.

You should be able to compile the \gnuplot{} source more or
less out of the box on any reasonable standard (ANSI/ISO C, POSIX)
environment.

\subsection{Legalize it!}

\Gnuplot{} is freeware authored by a collection of volunteers, who cannot
make any legal statement about the compliance or non-compliance of
\gnuplot{} or its uses. There is also no warranty whatsoever. Use at your
own risk.


Citing from the README of a mathematical subroutine package by R.
Freund:

\begin{quote}
For all intent and purpose, any description of what the codes are doing
should be construed as being a note of what we thought the codes did on
our machine on a particular Tuesday of last year.  If you're really
lucky, they might do the same for you someday.  Then again, do you
really feel *that* lucky?
\end{quote}

\subsection{Is \gnuplot{} Y2K compliant?}

\Gnuplot's compliance depends in part on the compliance of the underlying
operating system and hardware.  The only use \gnuplot{} makes of a system-
supplied date is in the "set timestamp" command, which simply echos the
date on the plot.  If the underlying OS cannot produce an accurate time
string, then the "set timestamp" command may fail to print the correct
date on plots.

In \gnuplot{} 3.5, if the user chooses to use \%y in a timestamp format,
rather than \%Y, it will print 2-digit rather than 4-digit years.  The
effects depend on the importance you place on the timestamps printed on
plots.

\Gnuplot{} 3.7 also allows the use of time/date data as variables, but the
user has complete control over the input format of the data and the
output format of the tic labels -- the same 2-digit "\%y" (interpreted
as 1900+) and 4-digit "\%Y" formats are both available.  But again,
these are user-specifiable, so if there is a Y2K problem here, it is the
responsibility of the user.

Of course, \gnuplot{} is built by executing a makefile, which may well be
date--dependent.  So if the operating system has a Y2K problem, the
process of building a new executable of \gnuplot{} may be affected.  But
that wouldn't be a problem with \gnuplot{} per se.

\textbf{IMPORTANT NOTICE}

As of \gnuplot{} beta version 3.7.0.9, the interpretation of the "\%y" two
digit year specifier was changed in accordance with the recommendations
of The Open Group and all major Unix vendors.  When a century is not
otherwise specified, values in the range 69-99 refer to the twentieth
century and values in the range 00-68 refer to the twenty-first century.
Be very careful when interpreting 2-digit year expressions.

\subsection{Where do I get further information?}

The following sites have more information about \gnuplot.

\begin{itemize}
\item \http{www.comnets.rwth-aachen.de/doc/gnu/gnuplot37/gnuplot.html}
	an online documentation in html--format
\item \http{www.usf.uni-osnabrueck.de/~breiter/tools/gnuplot/index.en.html}
	has many links to many features and add-ons for \gnuplot{}
\item \http{web.cs.uni.edu/Help/gnuplot/}
	contains an online tutorial
\item \http{brian.me.tufts.edu/GnuplotInLaTeX/}
	contains infos abount \gnuplot{} and \LaTeX{}
\item \http{ndevilla.free.fr/gnuplot/}
	explains the use of a \gnuplot{} API in ANSI C (commonly known
	as gnuplot\_pipes
\item \http{ricardo.ecn.wfu.edu/~cottrell/qplot/}
	on how to plot quarterly time data
\item \http{monsoon.harvard.edu/~mhagger/download}
	a Python interface for \gnuplot{}
\item \ftp{ftp.thewrittenword.com}{/free/by-package/}
	contains Solaris, IRIX, HP-UX and Digital Unix binaries
\item \http{www.sci.muni.cz/~mikulik/gnuplot.html}
	has Petr's famous OS/2 mouse support and the pm3d terminal
	for colour 3d surfaces. Furthermore some more links to
	other sites
\end{itemize}

Some documentation is available in other languages than English.
Those include:
\begin{itemize}
\item \http{www.multimania.com/~gersoo/gnuplt/index.html}
	contient des informations dans la langue de Moli\`ere:
	les 1ers pas avec \gnuplot, malheureusement seulement
	version 3.5. Vous trouverez un cours directement en ligne
	appelle\'e "1ers pas avec gnuplot". Le cours est aussi
	disponible en Postscript.
\item \http{www.al.lu/euler/gnuplot.shtml}
	encore des informations en langue fran\c{c}aise avec
	possibilit\'e de t\'el\'echargement des versions
	binaires
\end{itemize}

Here are some more sites, however these are somewhat outdated in
carrying still references to beta versions. If you download software
from there you should be aware that beta versions are not officially
endorsed.

\begin{itemize}
\item \http{www.cs.dartmouth.edu/gnuplot_info.html}
	slightly outdated site for the 3.6 beta version,
	but also a web-gateway to the users' newsgroup
\item \http{members.theglobe.com/gnuplot/}
	basically same as above.
\item \http{homepage.mac.com/gnuplot/}
	is the new site for a Macintosh port of \gnuplot{}
\end{itemize}

The following sites were said to exist, however they seem to be
down right now. 
\begin{itemize}
\item \http{www.geocities.com/SiliconValley/Foothills/6647/}
	the copyright statement and some binaries
	contains ads
\item \http{www.delorie.com/gnu/docs/gnuplot/gplot_toc.html} doesn't 
		work
\item \ftp{picard.tamu.edu}{/pub/gnuplot}
	gives  a tutorial
\item \http{feff.phys.washington.edu/~ravel/gnuplot}
	has a new mode for the users of (X)Emacs
\end{itemize}
    
\section{Setting it up}

\subsection{What is the current version of \gnuplot?}

The current version of \gnuplot{} is 3.7, which has many
improvements over 3.5. 3.6 was never released to avoid
confusions with the beta versions.

\subsection{Where can I get \gnuplot?}
\label{where-get-gnuplot}

The best place is definitly \http{www.gnuplot.info}. From there
you find various pointers to other sites.

The source distribution ("gnuplot-3.7.tar.gz" or a similar name) is
available from the official distribution site and its mirrors.

The main server is \ftp{ftp.gnuplot.info}{/pub/gnuplot/}. This server is
mirrored by several others, among those are
\begin{itemize}
   \item \ftp{mirror.aarnet.edu.au}{/pub/gnuplot/}
   \item \ftp{ftp.dartmouth.edu}{/pub/gnuplot/}
   \item \ftp{ftp.irisa.fr}{/pub/gnuplot/}
   \item \ftp{ftp.gnuplot.vt.edu}{/pub/gnuplot/}
\end{itemize}

You can also have a look at the following WWW-pages which provide a
source to obtain \gnuplot:
\begin{itemize}
    \item \http{members.theglobe.com/gnuplot/}
    \item \http{www.geocities.com/SiliconValley/Foothills/6647/}
    \item \http{mirror.aarnet.edu.au/pub/gnuplot/}
\end{itemize}

The current version for the Macintosh is 2.04b, based on
\gnuplot{} 3.5 pre3.6beta338, and is available from 
\begin{itemize}
\item \http{users.ece.gatech.edu/~schooley/}.
\end{itemize}
Unfortunately, this version does not seem to be maintained anymore.

Source and binary distributions for the Amiga are available on
Aminet \ftp{ftp.wustl.edu}{~aminet/} and its mirrors, for example
ftp.uni-kl.de, oes.orst.edu or ftp.luth.se.

MS-DOS and MS-Windows binaries are available from
the above servers and are called gp37dos.zip, gp37dj.zip, gp37w16.zip,
gp37mgw.zip, gnuplot3.7cyg.zip.

OS/2 binaries are called gp37os2.zip.

An X11 Window System front-end is available at 
\http{www.flash.net/~dmishee/xgfe/xgfe.html}.

The NeXTSTEP front end can be found at
\ftp{next-ftp.peak.org}{/pub/next/binaries/plotting/Gnuplot1.2_bin.tar.Z}.

A version for OS-9/68K can be found at
\ftp{cabrales.cs.wisc.edu}{/pub/OSK/GRAPHICS/gnuplot32x.tar.Z}; it
includes both an X-Window Systems and a non - X-Window Systems
version. 

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/vol2}.

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 \mailto{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.

If you can't locate a working archie server, you can use other web-based
search engines for searching for \gnuplot. One of these would be Lycos at
\http{ftpsearch.lycos.com/}.

As of June 1999, the \gnuplot{} distribution is also mirrored
at the Comprehensive TeX Archive Network (CTAN) in the
\texttt{graphics/gnuplot} directory. See
\begin{itemize}
\item \http{www.ctan.org/}.
\end{itemize}

Bug fixes can also be found at \gnuplot{} distribution sites
in the \texttt{patches} directory.

\subsection{How do I get \gnuplot{} to compile on my system?}

As you would any other installation. Read the files README.1ST
and README. 

For Unix, use configure and make. For DOS, if you are using bash and
DJGPP, you can just run \texttt{djconfig.sh}. For other platforms, copy
the relevant makefile from \texttt{config/} to \texttt{src}, change to
\texttt{src} and run make.


\subsection{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

\begin{itemize}
\item a Unix man page, which says how to start \gnuplot{}
\item a help file, which also can be printed as a manual
\item a tutorial on using \gnuplot{} with \LaTeX{}
\item a quick reference summary sheet for \TeX only
\end{itemize}

PostScript copies of the documentation can be ftp'd from
\ftp{ftp.dartmouth.edu}{/pub/gnuplot}, as \texttt{manual.ps.Z} and
\texttt{tutorial.ps.Z}

The documentation is built during the installation if you have \LaTeX{}
installed on your system, look in the
directories \texttt{docs} and \texttt{tutorial}.

Documentation about \gnuplot{} is available in the most common
formats at the \gnuplot{} distribution sites in the files 
\texttt{gpdoc.zip} and \texttt{gpdoc2.zip}.


\section{Working with it.}

\subsection{How do I get help?}

Read this document.

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.

If all these fail, please upgrade to the newest version of \gnuplot{}
or urge your system-administrator to do so. Then
post a question to \news{comp.graphics.apps.gnuplot} or send mail
to the gatewayed mailing list \mailto{info-gnuplot@dartmouth.edu}.
Do not forget to cite the version number and the operating system.
If you want to subscribe to the mailing list, send a mail to
\mailto{majordomo@dartmouth.edu} with the body of the message being
'subscribe info-gnuplot'. Please don't do this if you can get
\news{comp.graphics.apps.gnuplot} directly. If you post a
question there, it is considered good form to solicit e-mail
replies and post a summary.

\subsection{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.

\begin{verbatim}
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>
\end{verbatim}

In Microschrott Windows you click in the upper left
corner of the graph window and print directly from there.


\subsection{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. Vector formats should be preferred, as you can scale
your graph later to the right size.

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-DOSns OS/2), 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.tu-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 \texttt{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 \texttt{netpbm-1mar1994.tar.gz}.

Check archie (see Q\ref{where-get-gnuplot}) for an archive site near you.

For Microso\$t Windows and MacOS you can use the clip board to
copy your graph and paste it into your favourite Windows or
MacOS word processor.

\subsection{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 \verb+#define FIG+
into <term.h>), and use the xfig drawing program to edit the
plot afterwards. You can obtain the xfig program from its web site
\http{www.xfig.org/}. More information about the text-format used
for fig can be found in the fig-package.

You may use the tgif terminal, which creates output suitable for
reading within tgif (\http{bourbon.cs.umd.edu:8001/tgif/}),
an interactive 2-D drawing tool under X11.

Both tgif and xfig can also be obtained from the X Window contrib
distribution (see Q3.3).

Pstoedit can convert Postscript into a wide variety of formats.
Pstoedit is available a
\http{www.geocities.com/SiliconValley/Nework/1958/pstoedit/}.

Gimp may be able to post-process pixel graphics generated with
\gnuplot.

In general, you should use a vector graphics program to post-process
vector graphic formats, and pixel based programs for pixel graphics.


\subsection{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/reports/} as
11-92.ps.Z.


\subsection{How do I generate plots in the GIF format?}

If \gnuplot{} was compiled with the external GD library, there is a gif
terminal.

As of version 1.6, gd library dropped support for gif in favour of the
superior png format. For those who absolutely need gif support in \gnuplot{},
we are providing older versions of gd library at the \gnuplot{} distribution
sites which are free of Unisys patented code. Please read also the file
README a the ftp-sites.

\subsection{Can I animate my graphs?}

First have a look at animate.dem in the demo directory
of \gnuplot. Basically, animated graphs are a sequence of
plots in a suitable format.

Then have a look at the tool whirlgif 3.04, available at
\http{www.danbbs.dk/~dino/whirlgif}. It reads run-length 
encoded gifs and packs them into a minimal animation.
On the web-pages you will find a manual and an example.

You can also write a small script to get \gnuplot{} to output a family
of GIF files, then have it execute some animator such as gifsicle:
\http{http://www.lcdf.org/~eddietwo/gifsicle}
or gifmerge
\http{http://the-labs.com/GIFMerge}

mpeg\_encode will encode a sequence of images into the mpeg-format.


\subsection{How do I plot implicit defined graphs?}

Implicit graphs or curves cannot be plotted directly in \gnuplot.
However there is a workaround. 
\begin{verbatim}
gnuplot> # as example. Place your definition in the following line
gnuplot> f(x,y) = y - x**2 / tan(y)
gnuplot> set contour base
gnuplot> set cntrparam levels discrete 0.0
gnuplot> set nosurface
gnuplot> set term table
gnuplot> set out 'curve.dat'
gnuplot> splot f(x,y)
gnuplot> set out
gnuplot> set term {your usual terminal for interactive work}
gnuplot> plot 'curve.dat' w l
\end{verbatim}
The trick is to draw the single contour line z=0 of the surface
z=f(x,y), and store the resulting contour curve to a \gnuplot{} datafile.
 

\section{Wanted features}

\subsection{What's new in \gnuplot{} 3.7?}

Too many things to be named here.
Please refer to the NEWS file in the source distribution.


\subsection{Does \gnuplot{} have hidden line removal?}

Version 3.7 supports hidden line removal on all platforms;
use the command \verb+set hidden3d+.

The 16-bit binaries of \gnuplot{} support the hidden line removal
only partially as the hidden-line algorithm may hit
the 640k memory limit.


\subsection{Does \gnuplot{} support bar-charts/histograms/boxes?}

Use the style "with boxes" for bar charts. To get filled boxes,
you can try a modification by Steve Cumming and jturk, available via ftp
from the contrib directory
\ftp{ftp.ucc.ie}{/pub/gnuplot/contrib/gpl37fboxpatch.tar.gz}.

Bernhard Reiter wrote an AWK script to post-process the fig-terminal output.
Please have a look at
\http{www.usf.uni-osnabrueck.de/~breiter/tools/gnuplot/barcharts.en.html}.

\subsection{Does \gnuplot{} support pie charts?}

It's not possible in \gnuplot, but have a look at
\http{www.usf.uni-osnabrueck.de/~breiter/tools/piechart/piecharts.en.html}

\subsection{Does \gnuplot{} quarterly time charts?}

It's not possible in \gnuplot, but have a look at
\http{ricardo.ecn.wfu.edu/~cottrell/qplot}. The corresponding
file \verb+qplot.zip+ can be obtained from the contrib directory
on any \gnuplot{} server.


\subsection{Does \gnuplot{} support multiple y-axes on a single plot?}

Yes. You can have 2 x- and 2 y-axes per plot. See "plot".

\subsection{Can I put multiple pages on one page?}

Yes. "set multiplot"

If you use the postscript terminal and plot one graph per page you can
use the program mpage (\http{www.mesa.nl/pub/mpage}) to print
multiple logical pages per physical page. A similar program is
the psnup program in the psutils package. This package is available at
any CTAN mirror.


\subsection{Can I put both data files and commands into a single file?}

This is possible by the new \verb+plot "-"+ possibility. The
\verb+plot "-"+ command allows to read the data to be plot from
standard input or the current batch job.

\begin{verbatim}
gnuplot> plot "-"
1 1
2 4
3 9
<CTRL-D>
\end{verbatim}


\subsection{Can I put Greek letters and super/subscripts into my
labels?}

You might try using the \LaTeX{} terminal type and putting text
like \verb+"\\alpha_{3}"+ or \verb+'\alpha_{3}'+ into it.

The enhanced option in the postscript terminal is also able to use sub-
and superscripts. It also allows to use Greek letters and symbols
via symbol fonts.

If you include your \gnuplot-graphs into a \LaTeX{} document
you can use the \LaTeX{}-package psfrag to typeset any characters
into your graphs.

One more possibility is to use the MetaPost terminal. It supports \TeX{}
syntax and is converted onto encapsulated PostScript by mpost.


\subsection{Can I do 1:1 scaling of axes?}

Use "set size square".


\subsection{Can I put tic marks for x and y axes into 3d plots?}

Use the "with boxes" option.


\subsection{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.


\subsection{Can I put different text sizes into my plots?}

Some terminals, like the postscript terminal can, others can't.
Look at the help for the different terminals.


\subsection{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.


\subsection{How do I skip data points?}

By specifying ? as a data value, as in
\begin{verbatim}
        1 2
        2 3
        3 ?
        4 5
\end{verbatim}


\subsection{How do I plot every nth point?}

This can be specified with the various options for the command "plot".


\subsection{How do I plot a vertical line?}

Depending on context, the main methods are:
\begin{itemize}
\item \verb+set arrow .... .... nohead+ where you have to compute
explicitly the start and the end of the arrow.
\item generate (inlined) datapoints and plot them
\item switch to parametric mode
\end{itemize}

\subsection{How do I plot data files }

\subsection{How do I include accentuated characters in Postscript
output?}

To obtain accentuated characters like \"u or \^n into postscript plots
you should use the postscript character codes together with the
appropriate encoding option. See the following example:

\begin{verbatim}
gnuplot> set encoding iso_8859_1
gnuplot> set title "M\374nchner Bierverbrauch \374ber die Jahre"
gnuplot> plot "bier.dat" u 1:2
\end{verbatim}

\section{Miscellaneous}

\subsection{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 whether you have an old version of \gnuplot{}; if you do,
chances are the bug has been fixed in a newer release.

Fixes for bugs reported since the release of the current version are
held in the \texttt{patches} directory at \gnuplot{} distribution sites.
Before submitting a bug report, please check whether the bug in question
has already been fixed.

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 \news{comp.graphics.apps.gnuplot} is probably
the way to go. If you have investigated a problem in detail, especially
if you have a context or unified diff that fixes the problem, please
e-email a report to \mailto{bug-gnuplot@dartmouth.edu}.

The bug-gnuplot list is for reporting and collecting bug fixes, the
\news{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) as shown by the command "show version long",
terminal driver, operating system, an exact description of the bug and
input which can reproduce the bug. Failure to indicate these details can
render a solution to your problem almost impossible. Also, any context
diffs should be referenced against the latest official version of
\gnuplot{} if at all possible.


\subsection{Can I use \gnuplot{} routines for my own programs?}

Yes. John Campbell \mailto{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.gz at
\ftp{ftp.nau.edu}{/pub/gplotlib.tar.gz}. This library
has been updated to be compatible with version 3.5.

On systems supporting the pipes, you can pipe commands to
\gnuplot{} from other programs.


\subsection{What extensions have people made to \gnuplot? Where can I get
them?}

Extensions are available from
\ftp{ftp.ucc.ie}{/pub/gnuplot/contrib/}

Some extensions available:
\begin{itemize}
\item \texttt{barchart\_via\_fig}: awk scripts to produce barcharts with
filled boxes.
\item \texttt{date-errorbar}: allows dates in the hi/lo fields for 
errorbars.
\item \texttt{gp37os2-mouse}: OS/2 binaries with mouse support (feature
included in current beta versions).
\item \texttt{perltk}: A perl/tk canvas widget.
\item \texttt{polyg.patch}: Implements a polygon plotting style.
\item \texttt{xgfe}: graphical front end using the Qt widgets available
at \http{lnc.usc.edu/docs/xgfe/xgfe.html}.
\item \texttt{Gnuplot.py}: A python package to create graphs from
within python. More information at
\http{monsoon.harvard.edu/~mhagger/Gnuplot/Gnuplot.html}.
\end{itemize}

\subsection{I need an integration, fft, iir-filter,....!}

\Gnuplot{} has been and is a plotting program, no data
processing or mathematical program suite. Therefore \gnuplot{}
can't do that. Look into the demo "bivariat.dem" for a basic
implementation of an integration.

For more sophisticated data-processing read the next section.

\subsection{Can I do heavy-duty data processing with \gnuplot? or
What is beyond \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 (\texttt{isaac@frodo.physics.mcgill.ca}). It can use
\gnuplot{} as its graphics back end and is available from
\ftp{ftp.physics.mcgill.ca}{/pub/Fudgit/fudgit_2.33.tar.Z} and from
the main Linux server, tsx-11.mit.edu and its numerous mirrors around
the world as \texttt{/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 \verb+fudg_231.zip+.

Carsten Grammes has written a fitting program which has been
merged into \gnuplot{} 3.7.

Michael Courtney has written a program called lsqrft, which uses the
Levenberg-Marquardt - Algorithm for fitting data to a function. It is
available from
\ftp{hobbes.nmsu.edu}{/pub/os2/apps/analysis/lsqrft15.zip};
sources, which should compile on Unix, and executables for MS-DOS and
OS/2 are available.  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
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/AAO/local/www/kgb/pgperl}, 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 
from \http{www.che.wisc.edu/octave/} and via
anonymous ftp from \ftp{bevo.che.wisc.edu}{/pub/octave}.
Octave is licensed under GPL (see \http{www.gnu.org/copyleft/gpl.html}).
By the way, octave uses \gnuplot{} as its plotting engine, so
you get a data-processing program on top of \gnuplot{}.

Finally, there is scilab at \http{www-rocq.inria.fr/scilab/}
doing about the same as matlab. It is free but copyrighted
software.


\subsection{I have ported \gnuplot{} to another system, or patched it. What
do I do?}

If your patch is small, mail it to
\mailto{info-gnuplot-beta@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), place them on a web/ftp site for download. There is currently
no possibility to upload patches. Send a note to
\mailto{info-gnuplot-beta@dartmouth.edu} on where to find the patch,
what it is supposed to do, which version of \gnuplot{} it is to be applied
against. For the time being (summer 1999) you can also send the patch to
\mailto{gnuplot@ftp.ucc.ie}.


\subsection{I want to help in developing the next version of \gnuplot.
What can I do?}

Join the \gnuplot{} beta test mailing list by sending a mail
containing the line
\verb+subscribe info-gnuplot-beta+
in the body (not the subject) of the mail to
\mailto{Majordomo@Dartmouth.EDU}.

Also check with \http{sourceforge.net/projects/gnuplot} about latest
source for beta releases for development.

\subsection{Open questions for inclusion into the FAQ?}


\mailto{info-gnuplot-beta@Dartmouth.EDU}.

Please submit your questions (along with the answer) to 
\mailto{info-gnuplot-beta@Dartmouth.EDU}.

\section{Making life easier}

\subsection{How do I plot two functions in non-overlapping regions?}

Use a parametric plot. An example:
\begin{verbatim}
gnuplot> set parametric
gnuplot> a=1
gnuplot> b=3
gnuplot> c=2
gnuplot> d=4
gnuplot> x1(t) = a+(b-a)*t
gnuplot> x2(t) = c+(d-c)*t
gnuplot> f1(x) = sin(x)
gnuplot> f2(x) = x**2/8
gnuplot> plot [t=0:1] x1(t),f1(x1(t)) title "f1", x2(t), f2(x2(t)) title "f2"
\end{verbatim}

You can also use \gnuplot's ability to ignore mathematically undefined
expressions: the expression \verb+1/0+ is silently ignored, thus a
construction like
\begin{verbatim}
gnuplot> set xran [-10:10]
gnuplot> plot (abs(x)>0.5?1/0: x**2)
\end{verbatim}
plots a quadratic function only for \verb+|x| < 0.5+.


\subsection{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

\begin{verbatim}
gnuplot> plot "< awk ' { print $1, $3/$2 } ' file.in"
\end{verbatim}

The plot command is very powerful and is able to do some
arithmetic on datafiles. See "help plot".


\subsection{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{ftp.dartmouth.edu}{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.


\subsection{How do I save and restore my settings?}

Use the "save" and "load" commands for this; see "help save"
and "help load" for details.


\subsection{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.


\subsection{How do I plot a function f(x,y) which is bounded by other
          functions in the x-y plain?}

An example:
\begin{verbatim}
gnuplot> f(x,y) = x**2 + y **2
gnuplot> x(u) = 3*u
gnuplot> yu(x) = x**2
gnuplot> yl(x) = -x**2
gnuplot> set parametric
gnuplot> set cont
gnuplot> 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)
\end{verbatim}


\subsection{How do I get rid of <feature> in a plot?}

Usually, there is a set command to do this; do a
	\verb+ gnuplot> ?set no+
   for a short overview.


\subsection{How do I call \gnuplot{} from my own programs?}

There's a code which works for a UNIX system, using (efficient)
named pipes. On M\$ Windows platforms, due to the lacking standard
input of GUI programs, you need to use the C-code \texttt{pgnuplot}
written by Hans-Bernhard Broeker
\mailto{broeker@physik.rwth-aachen.de}. You can obtain this file on
a ftp-server carrying the source for \texttt{gnuplot}.


\subsection{What if I need h-bar (Planck's constant)?}

There is no predefined variable like pi. However to put h-bar as
a character into the label, you must use the PostScript terminal.
You can play around with constructs like
\verb+ @{/=56 -} {/=24 h}+ or
\verb+ {/=8 @{/Symbol=24 -} _{/=14 h}}+
In the latter, the "-" (a long one in /Symbol) is non-spacing and 24-pt.
The 14-pt "h" is offset by an 8-pt space (which is the space preceding
the "\_") but smaller, since it's written as a subscript.
But these don't look too much like the hbar we're used to, since the bar
is horizontal instead of sloped.  I don't see a way to get that.  I
tried using an accent (\\264 in isoLatin encoding), but I haven't found a
way to scale and position the pieces correctly.

One more possibility would be
\verb+{/=14 @^{/Symbol=10 -}{/=14 h}}+.

(This is a hint by Richard Crawford).



\section{Known Problems}

\subsection{\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:

\begin{verbatim}
        $ gnuplot_x11 :== $disk:[directory]gnuplot_x11
        $ gnuplot :== $disk:[directory]gnuplot.exe
        $ def/job GNUPLOT$HELP disk:[directory]gnuplot.hlb
\end{verbatim}

Then run \gnuplot{} from your command line, and use
"set term x11".

If you run \gnuplot{} on Unix systems, be sure that the newest
\verb+gnuplot_x11+ is the first in your search path.


\subsection{My isoline data generated by a Fortran program is not
handled correctly. What can I do?}

Update to the newest \gnuplot.
\Gnuplot{} 3.7 is able to read Fortran-style
files where a blank line can contain more than a linefeed.


\subsection{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:


\begin{verbatim}
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`
\end{verbatim}

The solution is to change \gnuplot's idea of "zero":
\begin{verbatim}
gnuplot> set zero 1e-20
\end{verbatim}

For more information, "help set zero"

\subsection{\Gnuplot{} is plotting nothing when run via \gnuplot{}
	<filename>!  What can I do?}

Put a pause -1 after the plot command in the file. On an X-Window System
system, you can also use the \verb+-persist+ option, the X11 window is
then not closed. Close the X11 window by typing "q" when the focus is on
it.


\subsection{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:


\begin{verbatim}
gnuplot> print 1/3
                0
gnuplot> print 1./3.
                0.333333
\end{verbatim}

This way of evaluating integer expressions is shared by both C and
Fortran.

%
% Outdated, isn't it?!
%
%\subsection{My Linux \gnuplot complains about a missing
%\texttt{gnuplot\_x11}. What is wrong? }
%
%The binary \gnuplot distribution from sunsite.unc.edu and its
%mirrors in \texttt{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.

\subsection{Set output 'filename' isn't outputting everything it
should!}

You need to flush the output with a closing 'set output'.


\subsection{When using the \LaTeX--terminal, there is an error during
the \LaTeX--run!}

Please upgrade to \gnuplot{} 3.7. Some versions of its beta-release had
a problem in the \LaTeX--terminal.

The \LaTeX 2$\epsilon$-core does no longer include the commands
"\\Diamond" and "\\Box"; they are included in the latexsym package,
which is part of the base distribution and thus part of any LaTeX
implementation.  Please do not forget to use this package.

\subsection{The \texttt{exit} command does not work as documented!}

This is a known bug and is fixed in the latest release. If you need
the feature please upgrade to the latest release.

\subsection{I can't find the demos and example files at the URLs in the
documentation!}

The examples have been removed from the NASA site. You can find the
examples now at \http{www.gnuplot.vt.edu/gnuplot/gpdocs}. There you
will find both PNG and GIF versions of the demo plots. There are some
licensing problems with GIF images, so you should probably prefer the
PNG ones. They also have the advantage to be much smaller in size.

\subsection{Calling \gnuplot{} in a pipe or with a \gnuplot-script
doesn't produce a plot!}

You can call \gnuplot{} by using a short Perl-script like the
following:
\begin{verbatim}
#!/usr/local/bin/perl -w
open (GP, "|/usr/local/bin/gnuplot -persist") or die "no gnuplot";
# force buffer to flush after each write
use FileHandle;
GP->autoflush(1);
print GP,"set term x11;plot '/tmp/data.dat' with lines\n";
close GP
\end{verbatim}

\Gnuplot{} closes its plot window on exit. The \verb+close GP+
command is executed, and the plot window is closed even before you have
a chance to look at it.

There are three solutions to this: first, use the \verb+pause -1+
command in \gnuplot{} before closing the pipe. Second, close the pipe
only if you are sure that you don't need \gnuplot{} and its plot window
anymore. Last, you can use the command line option \verb+-persist+: this
option leaves the X-Window System plot window open.


\section{Credits}

\Gnuplot{} 3.7's main contributors are (in alphabetical order)
Hans-Bernhard Broeker, John Campbell, Robert Cunningham, David Denholm,
Gershon Elber, Roger Fearick, Carsten Grammes, Lucas Hart, Lars Hecking,
Thomas Koenig, David Kotz, Ed Kubaitis, Russell Lang, Alexander Lehmann,
Alexander Mai, Carsten Steger, Tom Tkacik, Jos Van der Woude, James R.
Van Zandt, and Alex Woo.

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.
Again reworked for \gnuplot{} 3.7 by Alexander Mai and Juergen v.Hagen
with corrections by Lars Hecking, Hans-Bernhard Broecker and other
people.


\end{document}
%%
%% $Id: faq.tex,v 1.1.1.1 2002/12/07 18:33:30 lhecking Exp $
%%
%% $History$
%%
