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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the lower bound of data.double[]Returns the upper bound of data.static Surfaceof(double[][] z, int k) Creates a regular mesh surface with the jet color palette.static SurfaceCreates a regular mesh surface.static Surfaceof(double[] x, double[] y, double[][] z) Creates an irregular mesh grid.static Surfaceof(double[] x, double[] y, double[][] z, int k) Creates an irregular mesh surface with the jet color palette.static SurfaceCreates an irregular mesh surface.voidDraws 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.palette- the color palette.
-
-
Method Details
-
getLowerBound
public double[] getLowerBound()Description copied from class:PlotReturns the lower bound of data.- Specified by:
getLowerBoundin classPlot- Returns:
- the lower bound of data.
-
getUpperBound
public double[] getUpperBound()Description copied from class:PlotReturns the upper bound of data.- Specified by:
getUpperBoundin classPlot- Returns:
- the upper bound of data.
-
paint
-
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.- Returns:
- the plot.
-
of
-
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.- Returns:
- the plot.
-
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.k- the number of colors in the palette.- Returns:
- the plot.
-
of
-