Class Contour
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.Contour
A contour plot is a graphical technique for representing a 3-dimensional
surface by plotting constant z slices, called contours, on a 2-dimensional
format. That is, given a value for z, lines are drawn for connecting the
(x, y) coordinates where that z value occurs. The contour plot is an
alternative to a 3-D surface plot.
-
Constructor Summary
ConstructorsConstructorDescriptionContour(double[][] z, double[] levels) Constructor.Contour(double[][] z, int numLevels, boolean logScale) Constructor.Contour(double[] x, double[] y, double[][] z, double[] levels) Constructor.Contour(double[] x, double[] y, double[][] z, int numLevels, boolean logScale) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfigure()Returns a figure containing the plot.double[]Returns the lower bound of data.double[]Returns the upper bound of data.static Contourof(double[][] z) Creates a contour plot with 10 isolines.static Contourof(double[][] z, int numLevels) Creates a contour plot.static Contourof(double[] x, double[] y, double[][] z) Creates a contour plot with 10 isolines.static Contourof(double[] x, double[] y, double[][] z, int numLevels) Creates a contour plot.voidDraws the shape.
-
Constructor Details
-
Contour
public Contour(double[][] z, int numLevels, boolean logScale) Constructor.- Parameters:
z- the data matrix to create contour plot.numLevels- the number of contour levels.logScale- true to interpolate contour levels in logarithmic scale.
-
Contour
public Contour(double[][] z, double[] levels) Constructor.- Parameters:
z- the data matrix to create contour plot.levels- the level values of contours.
-
Contour
public Contour(double[] x, double[] y, double[][] z, int numLevels, boolean logScale) Constructor.- Parameters:
x- the x coordinates of the data grid of z. Must be in ascending order.y- the y coordinates of the data grid of z. Must be in ascending order.z- the data matrix to create contour plot.numLevels- the number of contour levels.logScale- true to interpolate contour levels in logarithmical scale.
-
Contour
public Contour(double[] x, double[] y, double[][] z, double[] levels) Constructor.- Parameters:
x- the x coordinates of the data grid of z. Must be in ascending order.y- the y coordinates of the data grid of z. Must be in ascending order.z- the data matrix to create contour plot.levels- the level values of contours. Must be strictly increasing and finite.
-
-
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
-
figure
-
of
Creates a contour plot with 10 isolines.- Parameters:
z- the data matrix to create contour plot.- Returns:
- a contour plot.
-
of
Creates a contour plot.- Parameters:
z- the data matrix to create contour plot.numLevels- the number of contour levels.- Returns:
- a contour plot.
-
of
Creates a contour plot with 10 isolines.- Parameters:
x- the x coordinates of the data grid of z. Must be in ascending order.y- the y coordinates of the data grid of z. Must be in ascending order.z- the data matrix to create contour plot.- Returns:
- a contour plot.
-
of
Creates a contour plot.- Parameters:
x- the x coordinates of the data grid of z. Must be in ascending order.y- the y coordinates of the data grid of z. Must be in ascending order.z- the data matrix to create contour plot.numLevels- the number of contour levels.- Returns:
- a contour plot.
-