Data processed via a function)

Using the "ptolemy.plot.HistogramApplet" from the Plot.jar

A histogram plotter
The plot can be configured and data can be provided either through a file with commands or through direct invocation of the public methods of the class
To read a file or a URL, use the read() method

When calling the public methods, in most cases the changes will not be visible until paint() has been called
To request that this be done, call repaint()
One exception is addPoint(), which makes the affect of the new point visible immediately (or nearly immediately) if the plot is visible on the screen

The ASCII format for the file file contains any number commands, one per line
Unrecognized commands and commands with syntax errors are ignored
Comments are denoted by a line starting with a pound sign "#"
The recognized commands include those supported by the base class, plus a few more
The commands are case insensitive, but are usually capitalized
The number of data sets to be plotted does not need to be specified
Data sets are added as needed
Each dataset is identified with a color (see the base class)

The appearance of the histogram can be altered by the following commands:

     Bars: width
     Bars: width, offset

The width is a real number specifying the width of the bars as a fraction of the bin width
It usually has a value less than or equal to one, and defaults to 0
5
The offset is a real number specifying how much the bar of the i th data set is offset from the previous one
This allows bars to "peek out" from behind the ones in front
It defaults to 0
15
Note that the frontmost data set will be the first one

The width of each bin of the histogram can be specified using:

     BinWidth: width

This is given in whatever units the data has
By default, each bin is centered at x = nw, where w is the width of the bin and n is an integer
That bin represents values in the range (x - w/2, x + w/2)
The alignment of the bins can be changed with the following command:

     BinOffset: offset

If this method is used with argument o, then each bin is centered at x = nw + o, and represents values in the range (x - w/2 + o, x + w/2 + o)
So for example, if o = w/2, then each bin represents values from nw to (n + 1)w for some integer n
The default offset is 0
5, half the default bin width

To specify data to be plotted, start a data set with the following command:

     DataSet: string

Here, string is a label that will appear in the legend
It is not necessary to enclose the string in quotation marks
To start a new dataset without giving it a name, use:

     DataSet:

In this case, no item will appear in the legend
New datasets are plotted behind the previous ones
The data itself is given by a sequence of numbers, one per line
The numbers are specified as strings that can be parsed by the Double parser in Java
It is also possible to specify the numbers using all the formats accepted by the Plot class, so that the same data may be plotted by both classes
The x data is ignored, and only the y data is used to calculate the histogram