Package smile.plot.swing
Class Surface
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.Surface
A surface object gives 3D information e.g. a contour plots.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Returns the lower bound of data.double[]
Returns the upper bound of data.static Surface
of
(double[][] z, int k) Creates a regular mesh surface with the jet color palette.static Surface
Creates a regular mesh surface.static Surface
of
(double[] x, double[] y, double[][] z) Creates an irregular mesh grid.static Surface
of
(double[] x, double[] y, double[][] z, int k) Creates an irregular mesh surface with the jet color palette.static Surface
Creates an irregular mesh surface.void
Draws the shape.
-
Constructor Details
-
Surface
public Surface(double[][][] data) Constructor for irregular mesh grid.- Parameters:
data
- an m x n x 3 array which are coordinates of m x n surface.
-
Surface
Constructor for irregular mesh surface.- Parameters:
data
- an m x n x 3 array which are coordinates of m x n surface.
-
-
Method Details
-
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
-
paint
Description copied from class:Shape
Draws the shape. -
of
Creates a regular mesh surface with the jet color palette.- Parameters:
z
- the z-axis values of surface. The x-axis and y-axis location of surface will be set to 0.5, 1.5, 2.5, ...k
- the number of colors in the palette.
-
of
Creates a regular mesh surface.- Parameters:
z
- the z-axis values of surface. The x-axis and y-axis location of surface will be set to 0.5, 1.5, 2.5, ...palette
- the color palette.
-
of
Creates an irregular mesh grid.- Parameters:
x
- the x-axis values of surface.y
- the y-axis values of surface.z
- the z-axis values of surface.
-
of
Creates an irregular mesh surface with the jet color palette.- Parameters:
x
- the x-axis values of surface.y
- the y-axis values of surface.z
- the z-axis values of surface.
-
of
Creates an irregular mesh surface.- Parameters:
x
- the x-axis values of surface.y
- the y-axis values of surface.z
- the z-axis values of surface.palette
- the color palette.
-