GnuDraw -- General comments ---------------------------- GnuDraw is an ox package meant for creating GnuPlot graphics from Ox. The interface is completely based on the work of Jurgen Doornik, in his OxDraw package. Likewise, the documentation (see gnudraw.html, referred to below) is also largely a copy of Jurgen Doornik's oxdraw.html. When using Ox 3.20, GnuPlot can be called automatically from within Ox. Therefore, ShowDrawWindow can be used, displaying graphs immediately on screen. On Unix, SetDrawWindow can be used to have the graphs appear in the same screen for every new plot, thus allowing for animations to appear on screen. See packages/gnudraw/samples/ar1.ox. The resulting GnuPlot-files are in plain ASCII, and can be adapted to fit final needs. Output of the GnuPlot files can be of many different types. Included is support for EPS (bw and color), PNG (gif-like format) and TeX. Apart from these general comments, below are given short usage instructions, an overview of the extended functionality of GnuDraw, installation instructions, a description of directories, of script/batch files, and of sample files. GnuDraw -- Usage ----------------- Usage of GnuDraw is intended to be simple. Use it just like you would use the original ox drawing routines, changing only the line #include to #include See the original ox documentation for usage instructions of the normal routines, and also the file packages/gnudraw/doc/gnudraw.html for gnudraw-specific explanation GnuDraw -- Extended functionality ---------------------------------- First of all, extra output formats are available in GnuDraw. GIF images can be created for use on web pages, and pure (Pic)TeX for inclusion in TeX documents. The GnuPlot output files are more easily edited (also on Unix) to change the final appearance of graphs, without having to resort to re-running the Ox-programs or changing to a Windows computer to run GiveWin. Other extensions include: DrawTitle Includes the option (using -1 as the area designator) to put a title on top of the entire graphing area, instead of only on top one of the windows. DrawACF, DrawCorrelogram Option is included to combing plots of the autocorrelation function into one graphing window. DrawBivDensity Draw a bivariate density plot of a multivariate sample DrawDensity, DrawBivDensity Includes the option to plot a density of a weighted sample. DrawXYZ Draw a surface/contour plot of XYZ data DrawT, DrawTMatrix Now includes the possibility to draw irregularly spaced time series data. DrawAdjust Options are included to plot a series against a second x- or y-axis. SetDrawWindow On Unix, the graphics output can be directed to appear in the same plot window over and over again, allowing updating of graphs as in the Windows version in combination with GiveWin. GnuDraw -- Installation instructions ------------------------------------- To install GnuDraw, follow the next steps: (1) Unzip the file gnudraw.zip from your Ox folder (using folder names). This creates files in the directory /packages/gnudraw. In this case, no change of the OX3PATH environment variable is needed. Installation in a local directory is also possible; e.g. if you install under Windows in c:\myox, resulting in files in c:\myox\packages\gnudraw then make sure that the directory c:\myox is included in the OX3PATH variable. (2a Unix) Install GnuPlot if it wasn't done before, by downloading and installing the lastest rpm or other package. To use all options of GnuDraw, you'll need the 3.8 beta version; this version is for the moment only available from SourceForge.net, and installing it is not for the faint-of-heart. (2b Windows) Install GnuPlot if it wasn't done before, by downloading the latest windows binary of GnuPlot 3.8 Beta from http://www.sci.muni.cz/~mikulik/gnuplot/ Unzip the file into c:\program files\gp38iw32 (3a Unix) Change your path statement such that files in the /packages/gnudraw/bin can be found (these files are used for calling GnuPlot). Add a line similar to PATH="$PATH:/usr/local/lib/ox-3.20/packages/gnudraw/bin"; export PATH to your ~/.bashrc file. Test the change (possibly after logging out and in again) by typing the command execgnu at a command prompt. (3b Windows 95/98/ME/Millennium) Change your path statement such that files in the \packages\gnudraw\bat (these files are used for calling GnuPlot) and c:\progra~1\gp38iw32\binaries can be found. Add a line similar to set PATH=%PATH%;c:\progra~1\ox\packages\gnudraw\bat;c:\progra~1\gp38iw32\binaries to your autoexec.bat. Note the "c:\progra~1\" instead of "c:\program files": Windows does not like spaces in paths, the old dos-indication of the directoryname has to be used here. Test the change (after restarting) by typing the command execgnu at a command prompt. (3c Windows NT/2000/XP) Change your path statement such that files in the \packages\gnudraw\bat (these files are used for calling GnuPlot) and c:\progra~1\gp38iw32\binaries can be found. To do so, open Control Panel - System - Advanced - Environment Variables and create a new user variable with the name "path" and value %PATH%;c:\progra~1\ox\packages\gnudraw\bat;c:\progra~1\gp38iw32\binaries Note the "c:\progra~1\" instead of "c:\program files": Windows does not like spaces in paths, the old dos-indication of the directoryname has to be used here. Test the change (after logging out and in again) by typing the command execgnu at a command prompt. (4a) Put the file packages/gnudraw/doc/gnudraw.html in your list of bookmarks, or, better even, (4b) Edit /doc/oxmenu.html, adding a line GnuDraw graphics after the line referring to the original OxDraw documentation such that the documentation is available from the standard Ox documentation. (5 Optional) Associate files with extension .plt with c:\progra~1\gp38iw32\binaries\wgnuplot.exe and those with extension .plb with the batch file /packages/gnudraw/bin/plb2scr (Unix) or \packages\gnudraw\bat\plb2scr.bat (Windows) On Windows 95/98 systems, error messages might result if the environment space is not large enough. If a message like `Out of environment space' occurs, add a line shell=c:\windows\command.com /e:4096 /p to your c:\config.sys GnuDraw -- Directories ----------------------- Included in the file gnudraw.zip are the following directories: packages/gnudraw/bat Dos/Windows batch files used for getting gnuplot output converted packages/gnudraw/bin Unix script files used for getting gnuplot output converted packages/gnudraw/doc The documentation in HTML format packages/gnudraw/ The gnudraw package itself, and this explanation file packages/gnudraw/lib Libraries for computing kernel approximation to a density, and also for building bivariate plots using the oxdraw plotting routines packages/gnudraw/samples Example files GnuDraw -- Sample files ------------------------ In the directory /packages/gnudraw/samples/ some example files are given. The ox-programs create the gnuplot files, and if possible will create the eps/png/latex graphic files. Running gnuplot on files with extension *.plt recreates the final graphic files, which can be viewed using Ghostview or another image viewer, depending on the graphic file type. The plb-files can be translated using batch files plb2eps, plb2png, plb2scr etc. Sample files include: example.ox Creates the necessary files for example.tex example.tex LaTeX file providing an example of inclusion of EPS and TeX figures in LaTeX gnutest.ox Show a large set of possibilities using GnuDraw gnudmy.ox Display irregularly spaced time series data gnubiv1.ox, Display bivariate plotting capabilities. gnubiv2.ox gnudensis.ox Display a density plot for a weighted sample. ar1.ox A copy of the simulation class example file in /samples/simula/ar1.ox, only referring to gnudraw instead of oxdraw. It shows the possibilities of using SetDrawWindow to animate a graph (works only on Unix). drawacf.ox Show the drawing of multiple autocorrelation functions together in one graphing window drawbiv1.ox This example uses libbiv.ox, implementing DrawBivDensity for oxdraw, without using gnudraw itself. GnuDraw -- Script/batch files ------------------------------ Included in the directory packages/gnudraw/bin (Unix) or packages/gnudraw/bat (Windows) are batch-files which simplify the use of the output files with extension .plb. The batchfiles are called passing along the filename (without extension, under Windows), and optionally an indication of the font size and the size of the output graph. plb2scr Show on the screen plb2eps Build .eps in black & white plb2epsc Build .eps in color plb2gif Build .gif (on some platforms only) plb2png Build .png plb2tex Build .aux, for inclusion in tex document gnu2plt (Unix) Use 'source gnu2plt' to toggle creation of plt-files from plb-files by the plb2XXX scripts gnu2plt.bat (Windows) Use 'gnu2plt' to toggle creation of plt-files from plb-files by the plb2XXX scripts alplbscr [] Show all files (optionally only those starting with ) on the screen. alplbeps, alplbepsc, alplbgif, alplbpng, alplbtex Similar. execgnu Script file which is started from Ox under Windows, and which in turn starts gnuplot. list.exe Program used by alplbXXX to execute an OS command on a range of files Apart from the filename, some of the plb2XXX scripts take extra options If the PLB file was saved as a single-window graph of standard size, it can be resized using command line options for the plb2XXX scripts. Furthermore, plb2eps, plb2epsc and plb2tex take a fontsize as extra option, e.g. plb2eps example 1 .5 8 translates a file example.plb to example.eps of full width and half height, with a fontsize of 8. GnuDraw -- Further information ------------------------------- - The GnuPlot help-file is quite extensive. I tend to use GnuDraw for creating the rough graphs, saving the .plb files, and later on I embellish the graphs if necessary changing the internal GnuPlot commands in the ASCII file. In case of large difficulties, the (very active) mailing list comp.graphics.apps.gnuplot may be of help. - The file ps_guide.ps, included in many of the GnuPlot installations, explains how to use enhanced postscript to include mathematical symbols in the Encapsulated Postscript output of GnuPlot; the necessary commands can be given from within Ox. - The LaTeX packages psfrag allows for changing labels in EPS files to true LaTeX symbols, see the documentation in pfgguide.ps GnuDraw -- Open ends --------------------- The GnuDraw package is still under development. Newer versions might appear once in a while. For information, check my homepage. While creating graphs, temporary files are used. I try to delete all such files after usage, but some might be left. These files may have extensions *.log, or look like gd_.plt. Please let me know of installation problems, I was not able to check it on many different systems. Also, please drop me a line if you encounter bugs or are missing special functionality. Charles Bos cbos@feweb.vu.nl http://www.tinbergen.nl/~cbos/ December 19, 2002