|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--jsc.swt.plot2d.PlotPanel
|
+--jsc.swt.plot2d.AxesPlot
|
+--jsc.swt.plot2d.FunctionPlot2D
This class represents a plot of functions. Values of the functions y = f(x) are plotted on the vertical Y-axis against the horizontal X-axis.
The addFunction() method adds a function curve for f(x) to the plot.
Values of y = f(x) are calculated at n equally spaced x-values using an implementation
of the PlotFunction interface, where the getOrdinate() method should
return f(x) or Double.NaN if f(x) does not exist at x. The curve is
not plotted where f(x) does not exist.
Optionally, the area under the curve can be filled down to y = 0. This is often appropriate in statistical or probability plots, but may be inappropriate in general function plotting where the X-axis may not be at y = 0. Filling may also be inappropriate where f(x) does not exist over some parts of the X-axis.
| Field Summary |
| Fields inherited from class jsc.swt.plot2d.AxesPlot |
horizontalAxis, title, verticalAxis |
| Fields inherited from class jsc.swt.plot2d.PlotPanel |
componentBounds, hints, objects, SEE_THRU, virtualSpace, vt |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
FunctionPlot2D(AxisModel horizontalAxisModel,
AxisModel verticalAxisModel,
double x,
double y,
String title)
Creates the plot with given title and AxisModel objects.
|
|
FunctionPlot2D(AxisModel horizontalAxisModel,
AxisModel verticalAxisModel,
String title)
Creates the plot with given title and AxisModel objects.
|
|
| Method Summary | |
PlotShape |
addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour)
Add the curve of a function f(x) to the plot. |
PlotShape |
addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
boolean filled)
Add the curve of a function f(x) to the plot. |
PlotShape |
addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
Add the curve of a function f(x) to the plot. |
PlotShape |
addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke,
Paint paint,
boolean filled)
Add the curve of a function f(x) to the plot. |
PlotShape |
addFunction(PlotFunction f,
int n,
Color colour)
Add the curve of a function f(x) to the plot. |
PlotShape |
addFunction(PlotFunction f,
int n,
Color colour,
Stroke stroke)
Add the curve of a function f(x) to the plot. |
| Methods inherited from class jsc.swt.plot2d.AxesPlot |
addVerticalLine, addVerticalLine, clone, copy, getHorizontalAxis, getTitle, getVerticalAxis, outsideAxes, paintComponent, rescaleHorizontal, rescaleVertical, setClipping, setPaintXaxis, setPaintYaxis, setTitle |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FunctionPlot2D(AxisModel horizontalAxisModel,
AxisModel verticalAxisModel,
String title)
AxisModel objects.
The axes meet at their minimum values.
horizontalAxisModel - the horizontal axis model.verticalAxisModel - the vertical axis model.title - the title of the plot.
public FunctionPlot2D(AxisModel horizontalAxisModel,
AxisModel verticalAxisModel,
double x,
double y,
String title)
AxisModel objects.
horizontalAxisModel - the horizontal axis model.verticalAxisModel - the vertical axis model.title - the title of the plot.| Method Detail |
public PlotShape addFunction(PlotFunction f,
int n,
Color colour)
PlotShape.
Redraws the plot.
Returns the PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.n - the number of points used to draw the curve.colour - the colour of the curve.
public PlotShape addFunction(PlotFunction f,
int n,
Color colour,
Stroke stroke)
PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.n - the number of points used to draw the curve.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotShape addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour)
PlotShape.
Redraws the plot.
Returns the PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.xMin - the minimum x value.xMax - the maximum x value.n - the number of points used to draw the curve.colour - the colour of the curve.
public PlotShape addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.xMin - the minimum x value.xMax - the maximum x value.n - the number of points used to draw the curve.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotShape addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
boolean filled)
PlotShape.
If filled is true, the area under the curve from xMin to xMax is filled
using the specified colour. Redraws the plot.
Returns the PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.xMin - the minimum x value.xMax - the maximum x value.n - the number of points used to draw the curve.colour - the colour of the curve.filled - if true, the area under the curve is filled.
public PlotShape addFunction(PlotFunction f,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke,
Paint paint,
boolean filled)
PlotShape that was added to the plot.
f - implements the function f(x) to be plotted.xMin - the minimum x value.xMax - the maximum x value.n - the number of points used to draw the curve.colour - the colour of the curve.stroke - the stroke style of the curve.paint - the paint style used to fill under the curve.filled - if true, the area under the curve is filled.
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||