Gri: introduction

Introduction 1: Introduction 2: Simple example 3: Fancy example 4: Running Gri 5: Programming Gri 6: General Issues 7: X-Y Plots 8: Contour Plots 9: Image Plots 10: Examples 11: Handling Data 12: Gri Commands 13: Gri Extras 14: Evolution of Gri 15: Installing Gri 16: Gri Bugs 17: System Tools 18: Acknowledgments 19: License 20: Newsgroup 21: Concept Index | # 1: Introduction Gri is a programming language for drawing science-style graphs. It is not mouse-driven, and it does not draw business-style graphs (e.g. pie charts, three-dimensional graphs). Gri has substantial power in advanced applications. It has been proven to be easy to learn; for simple applications, the learning curve is less than an hour. Many users regard Gri as the plotting equivalent of the LaTeX document preparation system. Computers Gri works on unix computers of many types, for example linux, sunOS/solaris, HP, IBM, DEC alpha, and Macintosh machten. It was developed on a solaris platform and linux platforms, so these are best tested. It also works, after a fashion, on windows-style computers. Running Gri is straightforward; just type its name see Invoking Gri. Capabilities of Gri are those scientists commonly want, since Gri was written by a scientist. It is not so useful for business people -- e.g., Gri draws xy graphs (see X-y Plots.), contour plots (see Contour Plots.), and image plots (see Images.), but it will not draw pie-charts unless you teach it how. The list of capabilities of Gri is similar to many packages, but unlike many of the other packages, Gri gives you control over line widths, fonts, grayscales, etc see Fancy Example, and it is a programming language of moderate power. The Gri drawing metaphor is that of pen on paper. The ink in the pen is opaque. An item drawn in white ink will erase a previously drawn underlying object drawn in black ink. For example, to draw a timeseries curve in which the region between positive data values and the y=0 axis is filled with black ink, you might use (``draw curve filled`') to draw the timeseries with black ink (the default color), blackening the area between the curve and the lower axis. Then you could load white ink into the pen (using the ``set graylevel 1`' or ``set graylevel white`' command) and white-out a box drawn between the zero line and the lower axis. Then you'd load black ink back into the pen (``set graylevel 0`') and draw the curve again, so that the negative part would appear again. Input/output in Gri may be interactive or non-interactive. For interactive use, type ``gri`' at the system commandline prompt. For non-interactive use, with Gri commands in a command-file called ``cmd.gri`', type ``gri cmd.gri`'. Gri output is in the PostScript page description language. The output is therefore of high quality, device-independent, capable of being inserted into popular text processors (e.g. LaTeX), and easily displayed see Viewing. Online help is got with the Gri command ``help`' makes Gri list the first words of all known commands, along with a hint for getting further help. To get more information, type ``help`' followed by a command-name (e.g. ``help read`'). There is also a tiny bit of information stored online and categorized by topic. Get this by typing for example ``help - strings`' see Online Help. Data analysis in Gri is limited. It has rudimentary data analysis functions, such as regression, column manipulation, smoothing, etc, but it is not intended as an integrated analysis/graphics package. System calls are an easy and important facet of Gri. It is easy to use operating system commands within Gri see System, see Operating System, see Get Env. This allows you to use familiar, powerful tools, and keeps Gri simple. Particularly useful is the ability to read files through operating system filters see Open. Programming Gri is quite straightforward, and users familiar with other programming languages find it easy. If Gri lacks a drawing method, you can add it fairly easily, since Gri has programming elements such as ``if`' statements see If Statements, ``while`' loops see While, facilities for interacting with the user see Query, and mechanisms for storing numbers in "variables" see Variables, and text strings in "synonyms" see Synonyms.. The Gri syntax can be augmented easily see Adding New Commands, and these augmentations can be stored in a startup file see Resource File, creating personalized versions of Gri. Manuals: Gri has an online texinfo manual, a PostScript manual, a WWW manual, a cookbook and several reference cards see Keeping Up To Date. It also has a mail-in newsgroup, which you can join by sending an email to ``majordomo@phys.ocean.dal.ca`' with contents ``subscribe gri`'. Version Numbering Scheme When you launch Gri interactively (without naming a commandfile, i.e. by just typing ``gri`' at the unix prompt), you'll see something like
    gri - scientific graphic program (version 2.4.4)
     GPL Copyright 2000 by Dan E. Kelley.

     Type `help' to view list of commands, or
     type `show license' to view license.  View
     /usr/doc/gri-2.4.4/html/gri1.html or access `gri'
     INFO node for the online manual.
The last line is a prompt. You can type commands; type ``quit`' to quit gri. The first line gives the version number. You can also get this by running Gri with the command ``gri -v`'. Version numbers have three numbers separated by periods. The first number increments for major changes, the second for smaller changes, the third for still smaller changes. The second number also indicates whether a copy is a test version or a (hopefully bug-free) release version. Odd numbers in the second place indicate test versions. Thus, ``2.1.0`' and versions normally goes through several changes as bugs are fixed or features are experimented with. But for release versions, e.g. ``2.2.x`', the last digit normally doesn't change much over time, since the program is meant to be relatively stable and bug-free.