org.omegahat.Graphics.Plots
Class ScatterPlot

java.lang.Object
  |
  +--org.omegahat.Graphics.Primitives.GraphicalObject
        |
        +--org.omegahat.Graphics.Primitives.RGO
              |
              +--org.omegahat.Graphics.Primitives.GraphicalElement
                    |
                    +--org.omegahat.Graphics.Plots.DataPlot
                          |
                          +--org.omegahat.Graphics.Plots.ScatterPlot

public class ScatterPlot
extends DataPlot


Field Summary
static int CURRENT_SCALE
           
static int EXTEND_SCALE
           
static int ICONS
           
static int LINES
           
static int NEW_SCALE
          the constants for rescaling: new scale, extended, or fit to current.
static int POINTS
           
 boolean verbose
           
 
Fields inherited from class org.omegahat.Graphics.Plots.DataPlot
dataRegion, DATAREGION, XAXISREGION, YAXISREGION
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalElement
allocator, children, origin, parent, scaleX, scaleY
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
fontSize, inRegion
 
Constructor Summary
ScatterPlot()
           
ScatterPlot(double[] x, double[] y)
           
ScatterPlot(double[] x, double[] y, int type)
           
ScatterPlot(Scale sx, Scale sy)
           
 
Method Summary
 GraphicalElement addData(double[] x, double[] y, int type, int rescale)
           
 GraphicalElement addIcons(double[] x, double[] y, int rescale)
          add an icon (the current default StringIcon in this call) at each of the points x[i], y[i].
 GraphicalElement addLines(double[] x, double[] y, int rescale)
           
 Scale dataScaleX(double[] x, int how)
          use the x array to scale or re-scale the x co-ordinates of the plot.
 Scale dataScaleY(double[] y, int how)
          use the y array to scale or re-scale the y co-ordinates of the plot.
 
Methods inherited from class org.omegahat.Graphics.Plots.DataPlot
bottomAxis, createDataRegion, dataRegion, make
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalElement
addGraphicalObject, addGraphicalObject, draw, parent, parent, setOrigin, setRegionAllocator, setXScale, setYScale, XScale, YScale
 
Methods inherited from class org.omegahat.Graphics.Primitives.RGO
justifyX, justifyY, setHJust, setVJust
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
getInRegion, getParameters, setInRegion, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POINTS

public static final int POINTS

LINES

public static final int LINES

ICONS

public static final int ICONS

NEW_SCALE

public static final int NEW_SCALE
the constants for rescaling: new scale, extended, or fit to current.

EXTEND_SCALE

public static final int EXTEND_SCALE

CURRENT_SCALE

public static final int CURRENT_SCALE

verbose

public boolean verbose
Constructor Detail

ScatterPlot

public ScatterPlot()

ScatterPlot

public ScatterPlot(Scale sx,
                   Scale sy)

ScatterPlot

public ScatterPlot(double[] x,
                   double[] y)

ScatterPlot

public ScatterPlot(double[] x,
                   double[] y,
                   int type)
Method Detail

addData

public GraphicalElement addData(double[] x,
                                double[] y,
                                int type,
                                int rescale)

addIcons

public GraphicalElement addIcons(double[] x,
                                 double[] y,
                                 int rescale)
add an icon (the current default StringIcon in this call) at each of the points x[i], y[i].

The added icons can extend or replace the current scale, or be clipped to it, depending on the value of the rescale argument.


addLines

public GraphicalElement addLines(double[] x,
                                 double[] y,
                                 int rescale)

dataScaleX

public Scale dataScaleX(double[] x,
                        int how)
use the x array to scale or re-scale the x co-ordinates of the plot. The second argument controls how the scaling is done: NEW_SCALE, EXTEND_SCALE, or CURRENT_SCALE.

dataScaleY

public Scale dataScaleY(double[] y,
                        int how)
use the y array to scale or re-scale the y co-ordinates of the plot. The second argument controls how the scaling is done: NEW_SCALE, EXTEND_SCALE, or CURRENT_SCALE.