org.omegahat.Graphics.Plots
Class Histogram

java.lang.Object
  |
  +--org.omegahat.Graphics.Primitives.GraphicalObject
        |
        +--org.omegahat.Graphics.Primitives.RGO
              |
              +--org.omegahat.Graphics.Primitives.GraphicalContainer
                    |
                    +--org.omegahat.Graphics.Plots.DataPlot
                          |
                          +--org.omegahat.Graphics.Plots.Histogram
All Implemented Interfaces:
Addable, Copyable, GraphicalComponentInt, GraphicalContainerInt, MathOperable, ScaledComponentInt, SimpleGraphicalContainerInt, Subsettable, Tree
Direct Known Subclasses:
DynamicHistogram

public class Histogram
extends DataPlot

a simple, basic histogram based on DataPlot whose contents are computed via the UnivariateSummary


Field Summary
protected  GraphicalComponentInt[] blocks
           
static java.awt.Color[] colors
           
 
Fields inherited from class org.omegahat.Graphics.Plots.DataPlot
dataRegion, xAxis, xLabel, yAxis, yLabel
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer
allocator, children, origin, parent, scaleX, scaleY
 
Fields inherited from class org.omegahat.Graphics.Primitives.RGO
region
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
ACTIVE, fontSize, lastDevice, lastHeightCM, lastRegion, lastWidthCM, parents, status, VISIBLE
 
Fields inherited from interface org.omegahat.Environment.DataStructures.MathOperable
DIVIDE, MINUS, MULTIPLY, PLUS
 
Constructor Summary
Histogram()
           
Histogram(double[] data, java.lang.String name)
          Create a histogram for the given data using the name as the name of the variable.
Histogram(NumericVariableInt v)
           
Histogram(Scale x)
          Create by specifying the X axis/scale, assuming the y axis is from 0 to 100.
Histogram(Scale x, Scale y)
           
Histogram(UnivariateSummary summary)
           
 
Method Summary
 boolean make(UnivariateSummary summary)
          Convenience {@see #make() make} method which converts the specified {@link org.omegahat.Graphics.Plots.DataStructures.UnivariateSummary UnivariateSummary} to a {@link org.omegahat.Graphics.Plots.DataStructures.HistogramContentsInt HistogramContentsInt} and then creates the elements of the plot.
 int makeBars(HistogramContentsInt content)
          Create the graphical elements that render the bar information in the histogram.
 GraphicalComponentInt makeBin(double left, double width, double height)
           
 HistogramContentsInt makeContents(UnivariateSummary summary)
          Creates a description of the histogram bins from a UnivariateSummary object, allowing derived classes to override this and users to provide their own implementation of HistogramContentsInt
 
Methods inherited from class org.omegahat.Graphics.Plots.DataPlot
bottomAxis, bottomAxis, createDataRegion, createDataRegion, createDataRegion, createRegionAllocator, dataRegion, getXAxis, getXLabel, getYAxis, getYLabel, leftAxis, leftAxis, make, setXAxis, setXLabel, setYAxis, setYLabel
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer
add, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addValue, copy, copy, draw, drawChildren, get, getChild, getChildCount, getChildren, getDevice, getOrigin, getRegionAllocator, getXScale, getYScale, parent, parent, remove, removeGraphicalObject, removeGraphicalObject, setOrigin, setRegionAllocator, setXScale, setYScale, subset, subset, transform, transform
 
Methods inherited from class org.omegahat.Graphics.Primitives.RGO
center, centre, createRegionDescription, createRegionDescription, getRegion, height, height, setHJust, setRegion, setVJust, width, width, x, x, y, y
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
cacheSize, getFontSize, getFontSize, getParameters, getParents, getStatus, isActive, isVisible, lastHeightCM, lastRegion, lastWidthCM, parents, setActive, setParameters, setParents, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omegahat.Graphics.Primitives.GraphicalComponentInt
getParameters, getRegion, isActive, isVisible, parents, setActive, setParameters, setRegion, setVisible
 

Field Detail

colors

public static java.awt.Color[] colors

blocks

protected GraphicalComponentInt[] blocks
Constructor Detail

Histogram

public Histogram(UnivariateSummary summary)

Histogram

public Histogram(double[] data,
                 java.lang.String name)
Create a histogram for the given data using the name as the name of the variable.

Histogram

public Histogram(NumericVariableInt v)

Histogram

public Histogram()

Histogram

public Histogram(Scale x)
Create by specifying the X axis/scale, assuming the y axis is from 0 to 100.

Histogram

public Histogram(Scale x,
                 Scale y)
Method Detail

make

public boolean make(UnivariateSummary summary)
Convenience {@see #make() make} method which converts the specified {@link org.omegahat.Graphics.Plots.DataStructures.UnivariateSummary UnivariateSummary} to a {@link org.omegahat.Graphics.Plots.DataStructures.HistogramContentsInt HistogramContentsInt} and then creates the elements of the plot.

makeBars

public int makeBars(HistogramContentsInt content)
Create the graphical elements that render the bar information in the histogram.

makeBin

public GraphicalComponentInt makeBin(double left,
                                     double width,
                                     double height)

makeContents

public HistogramContentsInt makeContents(UnivariateSummary summary)
Creates a description of the histogram bins from a UnivariateSummary object, allowing derived classes to override this and users to provide their own implementation of HistogramContentsInt