Package smile.plot.swing
Class Base
java.lang.Object
smile.plot.swing.Base
The coordinate base of PlotCanvas. This support both 2D and 3D
device-independent logical space where graphics primitives are specified.
The user need supply the lower and upper bounds for each axis. These bounds usually are extended (a little) internally for better view purpose.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extendBound
(double[] lowerBound, double[] upperBound) Extend lower and upper bounds.void
extendBound
(int i) Rounds the bounds for axis i.void
extendLowerBound
(double[] bound) Extend lower bounds.void
extendUpperBound
(double[] bound) Extend upper bounds.double[][]
Returns the coordinates.int
Returns the dimensionality of coordinates.double[]
Returns the lower bounds.int[]
Returns the precision unit digits of axes.double[]
Returns the precision units of axes.double[]
Returns the upper bounds.void
reset()
Reset base coordinates.void
setBound
(double[] lowerBound, double[] upperBound) Sets the axis bounds without applying the extending heuristic.toString()
-
Constructor Details
-
Base
public Base(double[] lowerBound, double[] upperBound) Constructor. -
Base
public Base(double[] lowerBound, double[] upperBound, boolean extendBound) Constructor.
-
-
Method Details
-
reset
public void reset()Reset base coordinates. Round/extend lower and upper bounds if necessary. -
getDimension
public int getDimension()Returns the dimensionality of coordinates. -
extendBound
public void extendBound(int i) Rounds the bounds for axis i. -
setBound
public void setBound(double[] lowerBound, double[] upperBound) Sets the axis bounds without applying the extending heuristic.- Parameters:
lowerBound
- the lower bound.upperBound
- the upper bound
-
getCoordinateSpace
public double[][] getCoordinateSpace()Returns the coordinates. -
getLowerBounds
public double[] getLowerBounds()Returns the lower bounds. -
getUpperBounds
public double[] getUpperBounds()Returns the upper bounds. -
getPrecisionUnit
public double[] getPrecisionUnit()Returns the precision units of axes. -
getPrecisionDigits
public int[] getPrecisionDigits()Returns the precision unit digits of axes. -
extendLowerBound
public void extendLowerBound(double[] bound) Extend lower bounds. -
extendUpperBound
public void extendUpperBound(double[] bound) Extend upper bounds. -
extendBound
public void extendBound(double[] lowerBound, double[] upperBound) Extend lower and upper bounds. -
toString
-