|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.Scatterplot
the basic x-data, y-data plot.
| Field Summary | |
static int |
CURRENT_SCALE
Maintain the current scale when new points are outside its range. |
static int |
EXTEND_SCALE
Extend the scale for new points falling outside the range of the current one. |
static int |
ICONS
alias for POINTS |
static int |
LINES
Use Lines for type of element in plot. |
static int |
MAX_TYPES
|
static int |
NEW_SCALE
Create a new scale when new points fall ouside the range of the current one. |
static int |
POINTS
Use Points for type of element in plot. |
static int |
WITH_BREAKS
alias for MAX_TYPES |
| 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 | |
Scatterplot()
|
|
Scatterplot(double[] x,
double[] y)
|
|
Scatterplot(double[] x,
double[] y,
int type)
|
|
Scatterplot(NumericVariableInt x,
NumericVariableInt y)
|
|
Scatterplot(RealVariable x,
RealVariable y)
|
|
Scatterplot(ScaleInt sx,
ScaleInt sy)
|
|
| Method Summary | |
GraphicalContainerInt |
addData(double[] x,
double[] y,
int type,
int rescale)
|
GraphicalContainerInt |
addIcons(double[] x,
double[] y,
javax.swing.Icon[] icons,
int rescale)
Add the icons from the array of icons, plotted at the x, y co-ordinates. |
GraphicalContainerInt |
addLines(double[] x,
double[] y,
int rescale)
Add a connected line segment through the data. |
GraphicalContainerInt |
addLinesWithBreaks(double[] x,
double[] y,
int rescale)
Add connected line segments, with breaks wherever either co-ordinate is NaN. |
GraphicalContainerInt |
addStringIcons(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]. |
void |
adjustScales()
|
ScaleInt |
dataScaleX(double[] x,
int how)
use the x array to scale or re-scale the x co-ordinates of the plot. |
ScaleInt |
dataScaleY(double[] y,
int how)
use the y array to scale or re-scale the y co-ordinates of the plot. |
void |
makeScales(double[] x,
double[] y)
|
void |
makeScales(double[] x,
double[] y,
int rescale)
Make (or remake) the scaling for the plot, using the data values and adjusting to leave a little extra space. |
protected boolean |
ok(double x,
double y)
Check for NaN, Inf values |
| 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 |
public static final int POINTS
public static final int LINES
public static final int ICONS
POINTSpublic static final int MAX_TYPES
public static final int WITH_BREAKS
MAX_TYPESpublic static final int NEW_SCALE
public static final int EXTEND_SCALE
public static final int CURRENT_SCALE
| Constructor Detail |
public Scatterplot()
public Scatterplot(ScaleInt sx,
ScaleInt sy)
public Scatterplot(double[] x,
double[] y)
public Scatterplot(double[] x,
double[] y,
int type)
public Scatterplot(RealVariable x,
RealVariable y)
public Scatterplot(NumericVariableInt x,
NumericVariableInt y)
| Method Detail |
public GraphicalContainerInt addData(double[] x,
double[] y,
int type,
int rescale)
public GraphicalContainerInt addStringIcons(double[] x,
double[] y,
int rescale)
The added icons can extend or replace the current scale, or be clipped to it, depending on the value of the rescale argument.
No icons will be plotted at any point for which one of the co-ordinates is NaN or Inf.
public GraphicalContainerInt addIcons(double[] x,
double[] y,
javax.swing.Icon[] icons,
int rescale)
All three arrays will be recycled to produce as many icons on the plot as the maximum of the three lengths. If the icons array is recycled, the resulting IconPrimitive objects will be distinct, but will refer to the same Icon object. This means that changing parameters on the objects in the GraphicalElement object returned by this call will change only those individual displayed objects, but changing a property of one of the icons in the array supplied in the call will change all the instances of that icon.
No icons will be plotted at any point for which one of the co-ordinates is NaN or Inf.
protected boolean ok(double x,
double y)
public GraphicalContainerInt addLines(double[] x,
double[] y,
int rescale)
No checks are made for possible NaN or Inf values. The input arrays are retained in the graphics object, so that subsequent changes to individual elements of the arrays will move the corresponding point when the plot is repainted. (This is not necessarily to be considered a feature.)
public GraphicalContainerInt addLinesWithBreaks(double[] x,
double[] y,
int rescale)
Copies are made of the input arrays; later changes in the elements will not be reflected in the plot.
public void makeScales(double[] x,
double[] y,
int rescale)
public void makeScales(double[] x,
double[] y)
public void adjustScales()
public ScaleInt dataScaleX(double[] x,
int how)
public ScaleInt dataScaleY(double[] y,
int how)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||