To unpack in the form given at the home page, you need the uncompress command. Or I have it in a .tar.bz2 format here.

If you are compiling on Linux, make sure to use the -DLCC option on your gcc command line. In other words, change the first line in makefile to

The command line is

jgraph input_file_name

with the results written to the standard output in Encapsulated Postscript. Redirect the output to a file (the -P option does NOT seem to work), and either view the file with ghostview or (this is the typical usage) use the output as an include file to LaTeX with psfig. (Conversion to PDF and JPEG, especially useful for PDFLaTeX, as well as to GIF, is covered below.)

Jgraph also can read from the standard input, which is handy if the input is piped from another program.

Below is an example of use. It is quite self-explanatory, drawing three graphs on the same figure. Two of the graphs are input from files, and the last one is based on points specified within the jgraph file itself. Note how I have indented, illustrating the elegant hierarchical nature of the jgraph command language.

Here is the example:

newgraph
   title : Figure 1
   xaxis 
      label : lambda
   yaxis
      label : ratio 

   newcurve
      linetype solid
      marktype none
      label : n = 10
      pts
         include 10.fil

   newcurve
      linetype solid
      marktype none
      label : n = 100
      pts
         include 100.fil

   newcurve
      linetype dashed
      marktype none
      pts 
         0 1 5 1

Here is an example of a vertical bar chart:


newgraph
   newcurve
      pts
         2 3 4 5 1 6
      marktype xbar
      marksize 0.4 0.1
      fill 0.8
   newcurve
      pts
         2 2 1 6.2
      marktype xbar

Here I've used the default for fill (grayness of filler in a bar) for the second bar chart.

By the way, the "include" files can contain comments just like the .jgr files can, using the notation

(* this is a comment *)

If you later wish to convert an Encapsulated Postscript file created by jgraph to JPEG, you can try GIMP, but I found this didn't work, at least using the defaults. Instead, you can use epstopdf to change to PDF, and then either GIMP or gs to convert to JPEG. For the latter, use

gs -sDEVICE=jpeg -sOutputFile=x.jpg x.pdf -dBATCH

where x.pdf is the input file.