|
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
|
+--jsc.swt.plot2d.PdfPlot
This class represents a plot of probability density functions. Methods are provided for adding any number of curves or bars representing continuous or discrete distributions respectively. Bars representing normalized frequency data can also be added to the plot.
| 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 | |
PdfPlot(AxisModel horizontalAxisModel,
AxisModel verticalAxisModel,
String title)
Creates the plot with given title and AxisModel objects.
|
|
| Method Summary | |
PlotShape |
addBars(FrequencyTable freq,
Color colour,
Paint paint,
Stroke stroke,
boolean filled)
Add a set of bars to the plot. |
PlotShape |
addBars(FrequencyTable freq,
Color colour,
Stroke stroke)
Add a set of bars to the plot. |
PlotShape |
addBars(FrequencyTable freq,
Paint paint)
Add a set of bars to the plot. |
PlotShape |
addBars(Tally tally,
double barWidth,
Color colour,
Paint paint,
boolean drawLines,
double offset)
Add a set of bars to the plot. |
PlotShape |
addPdf(Distribution d,
double xMin,
double xMax,
int n,
Color colour,
boolean filled)
Add the curve of pdf(x) of a continuous distribution to the plot. |
PlotShape |
addPdf(Distribution d,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
Add the curve of pdf(x) of a continuous distribution to the plot. |
PlotShape |
addPdf(Distribution d,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke,
Paint paint,
boolean filled)
Add the curve of pdf(x) of a continuous distribution to the plot. |
PlotShape |
addPdf(Distribution d,
int n,
Color colour)
Add the pdf curve of distribution d to the plot. |
PlotShape |
addPdf(Distribution d,
int n,
Color colour,
Stroke stroke)
Add the pdf curve of distribution d to the plot. |
PlotShape |
addPmf(Distribution d,
int n,
double xMin,
double xStep,
double barWidth,
Color colour,
Paint paint,
boolean drawLines)
Add the pmf bars of discrete distribution d to the plot. |
PlotShape |
addPmf(Distribution d,
int n,
double xMin,
double xStep,
double barWidth,
Color colour,
Paint paint,
boolean drawLines,
double offset)
Add the pmf bars of discrete distribution d to the plot. |
PlotShape |
addPmf(Distribution d,
int xMin,
int xMax,
double barWidth,
Color colour,
Paint paint,
boolean drawLines)
Add the pmf bars of discrete distribution d to the plot. |
double |
getOrdinate(double x)
Returns y = f(x). |
| Methods inherited from class jsc.swt.plot2d.FunctionPlot2D |
addFunction, addFunction, addFunction, addFunction, addFunction, addFunction |
| 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 PdfPlot(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.| Method Detail |
public PlotShape addBars(FrequencyTable freq,
Paint paint)
Color object).
Redraws the whole plot. Returns the PlotShape that was added to the plot.
freq - the table of frequencies.paint - the paint style if the bars are filled.
public PlotShape addBars(FrequencyTable freq,
Color colour,
Stroke stroke)
PlotShape that was added to the plot.
freq - the table of frequencies.colour - the colour of the bars.stroke - the stroke style if bars are not filled.
public PlotShape addBars(FrequencyTable freq,
Color colour,
Paint paint,
Stroke stroke,
boolean filled)
PlotShape that was added to the plot.
freq - the table of frequencies.colour - the colour of the bars.paint - the paint style if the bars are filled.stroke - the stroke style if bars are not filled.filled - if true, the bars are a filled;
otherwise the outline of the bars is drawn.
public PlotShape addBars(Tally tally,
double barWidth,
Color colour,
Paint paint,
boolean drawLines,
double offset)
If drawLines is true, the bars are drawn as lines using the given colour and bar width in device (pixel) coordinates. If drawLines is false, the bars are drawn as rectangles using the given bar width in virtual coordinates (usually 1.0 or less) and paint style.
The offset parameter is provided for the case where several sets of bars are added to the plot, and the bars from different sets need to be viewed alongside each other rather than superimposed. For example, if two sets of bars are added, the barWidth could be set to 0.5 in both cases, and offset set to -0.25 and +0.25 to separate the bars at each x-value.
Redraws the plot. Returns the PlotShape that was added to the plot.
tally - the table of frequencies.barWidth - the width of each bar in pixels if drawLines is true;
in virtual co-ordinates if drawLines is false.colour - the colour of the bars.paint - the paint style of rectangular bars.drawLines - if true, the bars are drawn as lines;
otherwise the bars are drawn as rectangles.offset - the horizontal virtual offset distance.
public PlotShape addPdf(Distribution d,
int n,
Color colour)
PlotShape.
d - a continuous distribution.n - the number of points used to draw the curve.colour - the colour of the curve.
public PlotShape addPdf(Distribution d,
int n,
Color colour,
Stroke stroke)
d - a continuous distribution.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 addPdf(Distribution d,
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.
d - a continuous distribution.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 addPdf(Distribution d,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
PlotShape that was added to the plot.
d - a continuous distribution.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 addPdf(Distribution d,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke,
Paint paint,
boolean filled)
If filled is true, the area under the curve from xMin to xMax is filled using the specified paint style.
Redraws the plot. Returns the PlotShape that was added to the plot.
d - a continuous distribution.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.
public PlotShape addPmf(Distribution d,
int xMin,
int xMax,
double barWidth,
Color colour,
Paint paint,
boolean drawLines)
If drawLines is true, the bars are drawn as lines using the given colour and bar width in device (pixel) coordinates. If drawLines is false, the bars are drawn as rectangles using the given bar width in virtual coordinates (usually 1.0 or less) and paint style.
Redraws the plot. Returns the PlotShape that was added to the plot.
d - a discrete distribution.xMin - the minimum x value.xMax - the maximum x value.barWidth - the width of each bar in pixels if drawLines is true;
in virtual co-ordinates if drawLines is false.colour - the colour of the bars.paint - the paint style of rectangular bars.drawLines - if true, the bars are drawn as lines;
otherwise the bars are drawn as rectangles.
public PlotShape addPmf(Distribution d,
int n,
double xMin,
double xStep,
double barWidth,
Color colour,
Paint paint,
boolean drawLines)
If drawLines is true, the bars are drawn as lines using the given colour and bar width in device (pixel) coordinates. If drawLines is false, the bars are drawn as rectangles using the given bar width in virtual coordinates (usually 1.0 or less) and paint style.
Redraws the plot. Returns the PlotShape that was added to the plot.
d - a discrete distribution.n - the number of bars.xMin - the minimum x value.xStep - the step distance.barWidth - the width of each bar in pixels if drawLines is true;
in virtual co-ordinates if drawLines is false.colour - the colour of the bars.paint - the paint style of rectangular bars.drawLines - if true, the bars are drawn as lines;
otherwise the bars are drawn as rectangles.
public PlotShape addPmf(Distribution d,
int n,
double xMin,
double xStep,
double barWidth,
Color colour,
Paint paint,
boolean drawLines,
double offset)
If drawLines is true, the bars are drawn as lines using the given colour and bar width in device (pixel) coordinates. If drawLines is false, the bars are drawn as rectangles using the given bar width in virtual coordinates (usually 1.0 or less) and paint style.
The offset argument is provided for the case where several sets of pmf bars are added to the plot, and the bars of the different distributions need to be viewed alongside each other rather than superimposed. For example, if bars for two distributions are added, the barWidth could be set to 0.5 in both cases, and offset set to -0.25 and +0.25 to separate the bars at each x-value.
Redraws the plot. Returns the PlotShape that was added to the plot.
d - a discrete distribution.n - the number of bars.xMin - the minimum x value.xStep - the step distance.barWidth - the width of each bar in pixels if drawLines is true;
in virtual co-ordinates if drawLines is false.colour - the colour of the bars.paint - the paint style of rectangular bars.drawLines - if true, the bars are drawn as lines;
otherwise the bars are drawn as rectangles.offset - the horizontal virtual offset distance.
public double getOrdinate(double x)
PlotFunctionDouble.NaN if f(x)
cannot be calculated at x.
getOrdinate in interface PlotFunctionx - the value of x.
Double.NaN if f(x) does not exist.
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||