bargraph - a graphing tool
bargraph [-h] [-v] [-q] [-ps] [-splot] [-gif] [-tk] [-color]
[-nocolor] [-landscape] [-nolandscape] [-size size]
[-options options] [-o output_file] [input_file]
Bargraph is a bar graph generating script. It reads a .bars file (described below). Its output depends on the command-line options, but it is currently able to create Encapsulated PostScript, GIF, or splot files. It can also generate a Tk window with the graph.
GIF generation is done via the GD library, which is available on CPAN. You must have GD, version 1.18, installed in order to use GIF generation. Newer versions of GD have removed GIF support, so they cannot be used with bargraph. I have not yet come up with a different way to generate GIF files, and I don't even know if I can do it in such a way as to not be a copyright violation. My suggestion is to generate PostScript and use other tools to do format conversion.
-h-v-q-ps-gif-splot-tk-color/-nocolor-landscape/-nolandscape-size <m>x<n>-options <string>-o <filename>-f <filename>
The input file should be a .bars file (described below). It will read
stdin if no input file is specified. The output file format depends
on the options. With -ps, it generates PostScript, with -gif, it
generates a GIF file, and with -splot, it generates splot. -tk
produces no textual output, just a window with the graph. If none of
-ps, -splot, -gif, or -tk are supplied, -ps is assumed. Any generated
text is printed to stdout or to the file specified by the -o option.
PostScript is the preferred back-end because it's the most flexible (the language was designed for this sort of thing). The other back-ends support subsets of PostScript's functionality. When a feature isn't supported by all back-ends, it's documentation will say so.
A .bars file consists of a short header with information about the title and axis labels, followed by a list of plots and text objects. I could write some kind of grammar for the data files, but you'd just ignore it anyway, so I'll show the format by example. By the way, if you're reading this as a man page, you may be a little confused since you won't see any pictures. If you build the html documentation, though, you'll see the pretty pictures.
Here's a very simple bargraph:
ex1.ps ex1.gif# ex1.bars # '#' is comment char Title: My Graph: -textfont helvetica20b XAxis: My X Axis: -labelalign center YAxis: My Y Axis: -labelalign center Key: right+(0.25*inch), top: Legend: -keytitlealign center Options: -keyall -rightmargin 2
Bar: 2: First Bar: 1: Second : -setcolor red Bar: 3: Third : -setcolor blue
This is about the simplest bargraph that illustrates all of the major parts. First of all, '#' is the comment character. Each command of the .bars file is a line itself. Lines may be extended by escaping the newline with '\'. The format of each line (with the Options: line being the exception) is:
object_tag: [<object specific stuff>]: object_name [: <options>]
The object_tag tells what kind of object is being defined, be it the title, the xaxis, or whatever. The following seven object tags are special: ``Title'', ``XAxis'', ``YAxis'', ``Key'', ``Colors'', ``Grays'', ``Options''. Any or all my be omitted, but any of them that are present must appear before any other object tags.
I'm sure you can guess what the Title, XAxis, and YAxis lines do. Don't worry about the syntax of the options yet; we'll come to that later. The Key line is a little bit more complicated. It takes an extra field in the format x_coord, y_coord. These coordinates of the upper left corner of the key are expressed in the coordinate system of the graph. Since some objects, like the key, can be difficult to place in graph coordiates, you are free to enter expressions for each coordiate. In reality, they can be any perl expression, but stick to regular arithmetic to avoid funny side-effects. In addition, there are a couple of predefined values that you can use in these expressions. For the x coordinate, ``left'' is the x coordinate of the left side of the graph, and ``right'' is the x coordinate of the right side of the graph. ``inch'' is a conversion factor having the dimensions of inches/x_unit. Similary, the y coordinate has the predefined values ``top'', ``bottom'', and ``inch''. The Options line just contains options that apply to the graph itself (not just an object on the graph). Again, don't worry about option syntax now.
As you can probably figure out, a bar definition is:
Bar: y_val : name [ : options ]
The name of a bar can be any string (including nothing) that doesn't contain \n or :. You can optionally have a third : followed by options for the bar. The options are discussed later. Also, note that the default color for a bar is black (the default bar color can be changed in the .bargraph file, also discussed below).
Now, that was nice and easy, but any number of tools make simple bargraphs without too much trouble. This next sample file introduces Clusters, an aggregate plot type:
ex2.ps ex2.gif# ex2.bars Title: Salesman Comparison XAxis: YAxis: Number of widgets sold Key: right+(0.25*inch), top : Legend : Options: -xlabel 0.25 -keyfirst -rightmargin 2 Colors: red blue black
BeginCluster: 1996
Bar: 2: Huey
Bar: 1: Dewey
Bar: 3: Louie
EndCluster
BeginCluster: 1997
Bar: 1: Huey
Bar: 3: Dewey
Bar: 2: Louie
EndCluster
Clusters are a good way to group related bars. Actually, you can have clusters of clusters, clusters of clusters and bars, or whatever. I'll leave that for the Examples section. I take it I don't have to describe the cluster syntax, but I'll do it for good measure:
BeginCluster: name [ : options ]
... Bar/Cluster/StackBar/etc. definitions ...
EndCluster
Bet you couldn't figure that one out. :-) Notice that the Cluster colored the bars (ie, no -setcolor options, and the bars weren't black). The Cluster gets its idea of what colors to use from the Colors: line. If we were generating a graph in black and white, it would use a Grays: line instead. The Colors: and/or Grays: lines may be omitted, in which case it will read these values from the .bargraph file (described below). It defaults to some bright, gaudy colors if you don't have a .bargraph file.
The third plot type is the StackBar. StackBars are just like clusters except that they can only contain bars (ie, no aggregate plots) and thay they stack the bars on top of each other. The same data file as above displayed using StackBars is shown below. It also introduces a text object, just for the sake of showing you one.
ex3.ps ex3.gif# ex3.bars Title: Another Salesman Comparison XAxis: YAxis: Number of widgets sold Key: right+(0.125*inch), top :: Options: -xlabel 0.25 -keyfirst -rightmargin 2
BeginStackBar: 1996
Bar: 2: Huey
Bar: 1: Dewey
Bar: 3: Louie
EndStackBar
BeginStackBar: 1997
Bar: 1: Huey
Bar: 3: Dewey
Bar: 2: Louie
EndStackBar
Text: right/2,top/2: Hee, Hee: -textalign center -textangle 90
The format for a text object is
Text: x, y: text [: options]
Just like the key, the x and y coordinates are in graph coordinates. Also like the key, expressions are allowed, as are the predefined values ``left'', ``right'', ``top'', ``bottom'', and ``inch''.
One note about StackBars is that negative values are perfectly legal. Each new positive bar in a StackBar is placed on top of the stack, while each new negative bar is placed below the stack. The ordering of bars with the same sign will affect the order in which the bars are stacked, but the ordering between positive and negative bars is irrelevant. Play with it for a minute if you're confused - it's rather intuitive, but I don't know how to describe it very well.
There are actually two more object types, called Rect and Line. If you want to draw either of these on the graph, use one of these expressions:
Rect: x1, y1, x2, y2: name [: options] Line: x1, y1, x2, y2: name [: options]
I assume you get the idea.
There's absolutely nothing to stop you from using clusters, stackbars, etc. all on the same graph. In fact, you can have clusters of stackbars and bars or other clusters or whatever you can dream up. Stackbars, however, may only contian bars (not clusters, other stackbars, etc.). If you can tell me what a stackbar of clusters should look like, I'd be very curious.
Well, as you can tell by the name, bargraph began life as a tool that makes bargraphs. It has since grown into a more general plotting tool, supporting scatter plots and line graphs. Note that bargraph was designed to deal with relatively small data sets (you wouldn't want a bargraph with thousands of bars, for instance), so don't be surprised if things don't work out so well if you try to generated scatter plots or line graphs with very large data sets. I refer to points and line plots collectively as 'series plots' because they share recognize the same options and have many similar properties.
The most basic series plot is a point. You can make a simple scatter plot by just defining a bunch of points, like I do in ex4.bars.
ex4.ps ex4.gif# ex4.bars Title: Very Simple Scatter Plot: -textfont helvetica20b XAxis: X Axis: -labelalign center YAxis: Y Axis: -labelalign center Options: -setcolor blue -setgray 0 -pointsize 10
Point: 1, 2: Point: 2, 4: Point: 3, 1: Important Point: -pointlabel name Point: 5, 3: Point: 5, 2:
Notice that I left the name of most of the points out - that just sets the name to the empty string. The same thing is legal for any other object definition, but I only got this lazy just now. I think you can figure out the point definition:
Point: x, y: name [: options]
This is starting to get monotonous. Anyway, to group related plots, use a Series object, which works much like a Cluster or StackBar, as ex5.bars shows:
ex5.ps ex5.gif# ex5.bars Title: Rather Simple Scatter Plot: -textfont helvetica20b XAxis: X Axis: -labelalign center YAxis: Y Axis: -labelalign center Key: right+(0.25*inch), top: Legend: -keytitlealign center Options: -pointsize 10 -keyall -rightmargin 2
BeginSeries: Series1:
Point: 1, 2:
Point: 2, 4:
Point: 3, 1: Important Point: -pointlabel name
Point: 5, 3:
Point: 5, 2:
EndSeries
BeginSeries: Series2: -pointtype triangle
Point: 1, 1:
Point: 2, 3:
Point: 3, 4:
Point: 4, 2:
Point: 5, 5:
EndSeries
If you need a description of the Series syntax at this point, then you need your head examined. The only thing interesting about this plot is that, as you can tell, the Series are colored. If you don't supply colors for series plots (using the soon-to-be-revealed options), they will default to the same colors in the same order that Clusters and StackBars use (which can be set in the Colors: line or the .bargraph file).
I know I said that bargraph will handle line graphs, too. Well, how are line graphs different from scatter plots? The dots are connected. To create a line graph you also want to use a series, but use the correct option to tell bargraph that you want the dots connected. Check this out:
ex6.ps ex6.gif# ex6.bars Title: Rather Simple Line Graph: -textfont helvetica20b XAxis: X Axis: -labelalign center YAxis: Y Axis: -labelalign center Key: right+(0.25*inch), top: Legend: -keytitlealign center Options: -pointsize 10 -keyall -rightmargin 2 -interpolation line
BeginSeries: Series1:
Point: 1, 2:
Point: 2, 4:
Point: 3, 1: Important Point: -pointlabel name
Point: 5, 3:
Point: 5, 2:
EndSeries
BeginSeries: Series2: -pointtype triangle
Point: 1, 1:
Point: 2, 3:
Point: 3, 4:
Point: 4, 2:
Point: 5, 5:
EndSeries
I don't want to go into the options here (read on if you do), but note that the only difference between ex5.bars and ex6.bars is the '-interpolation line' on the Options line. Hmmm. I wonder if that's it.
The .bars file is really very simple, so most of the complexity in creating a graph is setting all of the options. Of course, they're all optional, and the defaults usually look OK, so you should only have to deal with options if you want to play with the appearance of your graph.
Options are always given at the end of a line in the .bars file and are separated from the object's name by a colon. All options start with a dash, and all objects take one argument. Arguments are delimted by spaces. If you want to specify an argument that contains spaces, use a double-quoted string. You can escape a double-quotes within a double quoted string with a '\'. If no argument is specified, then ``1'' is assumed. Also, if ``foo'' is a valid option name, then the option ``-nofoo'' will assume an argument of ``0''. If an option is mutiply defined on a line, the last setting on the line will be used.
Options don't just apply to the objects they are defined for - they are also passed down to all contained objects. The graph contains the axes, the title, the key, text objects defined in the .bars file, all rects, and the top-level plots (plots that aren't contained in other plots). An aggregate plot (cluster, stackbar, or series) contains all plots between the Begin and End. Plots contain text objects that are implicitly created by the ``-xlabel'' and ``-printvalue'' options (descibed below). When an object looks for its options, it first looks for a value given on specification line. If the option is not defined there, it looks for its immediate container. If it can't find the option there, it looks for that object's container, etc. If the object is not defined anywhere, it uses a default. Because of this arrangement, the graph-level options (the Options: line in the .bars file) can be used as defaults for all other objects, since the graph includes all other objects. This all sounds like a mouthful, but it's very intuitive once you start using it. If an option doesn't work for all back-ends (ps, tk, and splot), the option description says so.
When a color is called for, use any string from /usr/lib/X11/rgb.txt. Case isn't important. When a gray is called for, use a value between 0 (black) and 1 (white). You can also use a color of the format 0xrrggbb, though this is supported for PostScript only. For fonts, use helvetica<n><suffix> or timesroman<n><suffix> where <n> is a number from 3-20 and <suffix> is either b (bold), i (italic), both, or nothing (normal). For example, helvetica20bi is 20-point Helvetica in bold and italics. For options that take graph coordinates, these coordinates are relative to the origin of the graph. Options that take no arguments are assumed to be boolean options -optionname turns it on and -nooptionname turns it off. Note that GD (the library that generates GIFs) does not have good-looking looking fonts, so don't expect nice fonts in your GIFs.
These options are defined for the graph object. These options normally appear on the ``Options:'' line in the .bars file. They may also appear on the command line (the -options switch). In the case of a conflict, options set on the command line override those set in the .bars file. These options can also be set in the .bargraph file (described below), and options in the .bargraph file can be overridden by anything in the .bars file or the command line. Graph options can be used as defaults for all other objects since all objects are contained (either directly or indirectly) by the graph object.
The Title object is just a normal Text object, with the exception that it defaults to center alignment instead of left alignment. Specify options they way you would for any Text object (described below).
The axes do a nice job of autoscalng themselves, but in case you want to mess with them, here's your chance. You specify these options on the XAxis: or YAxis: lines. You can give them in the global graph options (Options: line), and they will affect both axes.
If you want to make a key/legend, specify a Key: line in the .bars file. These options can be used on that line. Note that just specifying a Key: line will NOT add any plots to the key. You still must specify the -inkey Plot option to any plots that you want in the key or use the graph options -keyall or -keyfirst.
These options work for ALL plots: Bars, Clusters, StackBars, Points, and Series. Container objects (Clusters, Stackbars, and Series) pass their options down to their composite plots, which is generally what you want.
These options work for bar and bar-containing plots: bars, clusters, and stackbars. Be aware that clusters and stackbars pass their options down to composite plots.
These options are good for Points and Series. Note that options defined for a Series will also apply to all Points in that series (unless the Points override the settings).
At last, something really simple.
These let you specify options for framed rectangles. Note that whether -outlinecolor or -outlinegray (or -fillcolor/-fillgray) is used depends on whether the graph is being generated for color or grayscale (the value of the Graph option -color).
These options apply to Line objects that you might want to instantiate.
Here's a sample file that puts together a lot of different options. As complicated as it may look, it's fantastically simple to autogenerate .bars files like this. By the way, these numbers are all made up, so don't ask me anything about the wonderful prefetching stategies.
ex7.ps ex7.gif
# ex7.bars
Title: CPI Graph: -textfont helvetica15b
XAxis:
YAxis: CPI: -labelfont helvetica15b -labelalign center -grid
Key: right+(0.25*inch), top: Legend: -keytitlealign center
Options: -frame -rightmargin 2 -bottommargin 2 -topmargin 1 \
-printvalue -valuefont helvetica8 -valueangle 90 -valuealign left
BeginCluster: Config 1: -xLabel 1.50
BeginStackBar: No Prefetching : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base : -inkey
Bar: 0.5651 : Instn : -inkey
Bar: 0.4431 : Data : -inkey
EndStackBar
BeginStackBar: Strategy 1 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.3843 : Instn
Bar: 0.5131 : Data
EndStackBar
BeginStackBar: Strategy 2 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.5620 : Instn
Bar: 0.3232 : Data
EndStackBar
BeginStackBar: Strategy 3 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.6843 : Instn
Bar: 0.2322 : Data
EndStackBar
EndCluster
BeginCluster: Config 2: -xLabel 1.50
BeginStackBar: No Prefetching : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.5574 : Instn
Bar: 0.3234 : Data
EndStackBar
BeginStackBar: Strategy 1 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.1234 : Instn
Bar: 0.5663 : Data
EndStackBar
BeginStackBar: Strategy 2 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.3432 : Instn
Bar: 0.5342 : Data
EndStackBar
BeginStackBar: Strategy 3 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.2345 : Instn
Bar: 0.2344 : Data
EndStackBar
EndCluster
BeginCluster: Config 3: -xLabel 1.50
BeginStackBar: No Prefetching : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.3182 : Instn
Bar: 0.4642 : Data
EndStackBar
BeginStackBar: Strategy 1 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.2106 : Instn
Bar: 0.4841 : Data
EndStackBar
BeginStackBar: Strategy 2 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.1894 : Instn
Bar: 0.4810 : Data
EndStackBar
BeginStackBar: Strategy 3 : -xlabel 0.25 -xlabelfont helvetica8 \
-xlabelalign right -xlabelangle 90
Bar: 1.0000 : Base
Bar: 0.1783 : Instn
Bar: 0.4813 : Data
EndStackBar
EndCluster
Here's another example. This one includes clusters and negative values. Thanks to Dave Ofelt for contributing this one. The gif is not included because this is a landscape graph, and the GD library (which generates the gifs) doesn't do arbitrary text rotations, so text looks bad on landscape graphs (see -landscape documentation).
ex8.ps
# ex8.bars
Title: Signed Accuracies path.1
XAxis: Benchmark : -labeldist 1.5 -position 0
YAxis: Accuracy :
Key: right-(0.5*inch), top: Legend: -keywidth 1 -keytitlealign center
Options: -landscape -size 9x5 -keyfirst -xlabel 0.1 -xlabelangle 90 -xlabelalign right
BeginCluster: 008.espresso
Bar: 7.21994634581076 : p
Bar: 2.91651187879971 : rb
Bar: 6.01604964196798 : ri
Bar: 0.236182165248477 : rd
Bar: -3.75509872910472 : rall
EndCluster
BeginCluster: 013.spice2g6
Bar: 1.93064611191953 : p
Bar: -0.875099614141395 : rb
Bar: 1.87302674515113 : ri
Bar: 0.110036626237897 : rd
Bar: -1.27057618853105 : rall
EndCluster
BeginCluster: 015.doduc
Bar: 9.20072523231399 : p
Bar: 8.52396568604419 : rb
Bar: 7.08361258404677 : ri
Bar: 6.96210989479864 : rd
Bar: 4.42711326180885 : rall
EndCluster
BeginCluster: 022.li
Bar: 3.65203102180518 : p
Bar: 2.42282701462826 : rb
Bar: 3.15563306827675 : ri
Bar: -3.96622063213196 : rd
Bar: -4.81820427261216 : rall
EndCluster
BeginCluster: 026.compress
Bar: 5.56876958770596 : p
Bar: 0.747611603265597 : rb
Bar: 5.40809080187232 : ri
Bar: 4.2408008145284 : rd
Bar: -2.54629305563393 : rall
EndCluster
BeginCluster: 034.mdljdp2
Bar: -0.60094661920449 : p
Bar: -1.19942821350622 : rb
Bar: -0.615464421232192 : ri
Bar: -4.96012463562927 : rd
Bar: -5.41960514750469 : rall
EndCluster
BeginCluster: 039.wave5
Bar: 0.700052924227634 : p
Bar: 0.73271902458647 : rb
Bar: 0.435016309322633 : ri
Bar: -5.17171881768641 : rd
Bar: -5.30789825185712 : rall
EndCluster
BeginCluster: 047.tomcatv
Bar: 0.0350098724900327 : p
Bar: 0.125584473026996 : rb
Bar: 0.0145979025590437 : ri
Bar: -4.66222885167481 : rd
Bar: -4.66386989646473 : rall
EndCluster
BeginCluster: 048.ora
Bar: 0.382060880990154 : p
Bar: 0.763471645723857 : rb
Bar: 0.369880104512688 : ri
Bar: 0.0778891831247464 : rd
Bar: 0.419288767149362 : rall
EndCluster
Here's a line graph showing a timing diagram. It uses step interpolation.
ex9.ps ex9.gif# ex9.bars Title: 2-bit Counter: -textfont helvetica20b XAxis: Time: -labelalign center -grid YAxis: Signals: -labelalign center -nonumeric Key: right+(0.25*inch), top: Legend : -keytitlealign center
Options: -keyall -rightmargin 2 -pointsize 10 -interpolation step -pointtype none -linethickness 2
BeginSeries: Clock : -setcolor red
Point: 0, 10: Point
Point: 1, 9: Point
Point: 2, 10: Point
Point: 3, 9: Point
Point: 3, 9: Point
Point: 4, 10: Point
Point: 5, 9: Point
Point: 6, 10: Point
Point: 7, 9: Point
Point: 8, 10: Point
EndSeries
BeginSeries: HiBit: -setcolor black
Point: 0, 5:
Point: 2.2, 6:
Point: 4.2, 5:
Point: 6.2, 6:
Point: 8, 6:
EndSeries
BeginSeries: LoBit: -setcolor blue
Point: 0, 1:
Point: 1.1, 2:
Point: 2.1, 1:
Point: 3.1, 2:
Point: 4.1, 1:
Point: 5.1, 2:
Point: 6.1, 1:
Point: 7.1, 2:
Point: 8, 2:
EndSeries
Here's an example of a graph that uses Bars and Series on the same graph. It's a little tricky to know what x-coordinates to use for the series (since you don't know where the bars are), but you can always just make a bar graph and set the xaxis to numeric to do it by trial and error. This is a Quicken-inspired net worth graph.
ex10.ps ex10.gif# ex10.bars Title: Net Worth Graph: -textfont helvetica20b XAxis: Month: -labelalign center -position 0 -nonumeric YAxis: Dollars (x 1000): -labelalign center -format "$ %.0f" Key: (right+0.25*inch), top: Legend: -keytitlealign center Options: -rightmargin 2 -xlabel 0.25 -keyfirst -frame -grid
BeginStackBar: January Bar: -1: Debt : -setcolor red Bar: 5: Credits: -setcolor green EndStackBar
BeginStackBar: February Bar: -2: Debt: -setcolor red Bar: 4: Credits: -setcolor green EndStackBar
BeginStackBar: March Bar: -3.1: Debt: -setcolor red Bar: 6: Credits: -setcolor green EndStackBar
BeginSeries: net worth: -setcolor blue -interpolation line -pointtype x -pointsize 10 -pointlabel Point: 1.5, 4: Net Worth: -inkey Point: 3.5, 2: Net Worth: Point: 5.5, 2.9: Net Worth: EndSeries
This is the same as ex2, except that it uses fill patterns for the bars. This is a PostScript-only feature:
ex11.ps# ex11.bars Title: Salesman Comparison XAxis: YAxis: Number of widgets sold Key: right+(0.25*inch), top : Legend : Options: -xlabel 0.25 -keyfirst -rightmargin 2
BeginCluster: 1996
Bar: 2: Huey : -pattern x
Bar: 1: Dewey : -pattern fill
Bar: 3: Louie : -pattern stars_10
EndCluster
BeginCluster: 1997
Bar: 1: Huey : -pattern x
Bar: 3: Dewey : -pattern fill
Bar: 2: Louie : -pattern stars_10
EndCluster
Send me mail if you have interesting-looking .bars files that would make good examples. I'm too lazy to make more myself.
When bargraph runs, it tries to find a defaults file. If -f is
given or the environment variable BARGRAPH_DEFAULTS is set, it looks
there to find a defaults file. It is an error for a -f option to
be given or BARGRAPH_DEFAULTS to be set and to not be able to load the
file. If neither of these are set, bargraph will look for a defaults
file called ./.bargraph, and if that doesn't exists for .bargraph in
your home directory. If it doesn't find it there, it gives up and uses
defaults. Under MacPerl, the .bargraph file must be in the same
directory as the bargraph application or it will not be found. The
file is very simple. Here's an example:
colors: blue green red yellow black brown grays: 0.0 0.2 0.4 0.6 defaultColor: orange options: -rightmargin 2
All lines are optional. The colors: line sets the colors in order to use for a cluster. In this example, the first bar in a cluster will be blue, the second green, etc., and the sixth one brown. The seventh bar will be blue. Get the idea? grays: works the same way but with gray values. defaultColor is the color used to color bars that don't have any other way of getting a color (ie, aren't part of a cluster or stackbar and don't have a -setcolor option). It defaults to black. The options: line specifies default options to use for the graph. It acts as if these options were at the very beginning of the Options: line in each .bars file. If there is a conflict between options in the .bargraph and the .bars files, the .bars file options will have precedence over .bargraph options.
Send me mail if you find one.
Copyright (C) 1997, 1998, 1999 Jeff Gibson
These coded instructions, statements, and computer programs contain unpublished proprietary information of Jeff Gibson, and are protected by Federal copyright law. They may freely copied, but may not sold without the prior, written consent of Jeff Gibson.
Jeff Gibson <jeffg@labrat.stanford.edu>
perl(1).