smile.plot
Class Contour
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.Contour
-
public class Contour extends Plot
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
Constructors Constructor and Description Contour(double[][] z)Constructor.Contour(double[][] z, double[] levels)Constructor.Contour(double[][] z, double[] levels, java.awt.Color[] colors)Constructor.Contour(double[][] z, int numLevels)Constructor.Contour(double[][] z, int numLevels, boolean logScale)Constructor.Contour(double[] x, double[] y, double[][] z)Constructor.Contour(double[] x, double[] y, double[][] z, double[] levels)Constructor.Contour(double[] x, double[] y, double[][] z, double[] levels, java.awt.Color[] colors)Constructor.Contour(double[] x, double[] y, double[][] z, int numLevels)Constructor.Contour(double[] x, double[] y, double[][] z, int numLevels, boolean logScale)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(double[][] z)Create a plot canvas with the contour plot of given data.static PlotCanvasplot(double[][] z, double[] levels, java.awt.Color[] palette)Create a plot canvas with the contour plot of given data.static PlotCanvasplot(double[] x, double[] y, double[][] z)Create a plot canvas with the contour plot of given data.static PlotCanvasplot(double[] x, double[] y, double[][] z, double[] levels, java.awt.Color[] palette)Create a plot canvas with the contour plot of given data.voidshowLevelValue(boolean b)Set if show the level value with each contour line.-
Methods inherited from class smile.plot.Plot
getID, getToolBar, getToolTip, setID
-
-
-
-
Constructor Detail
-
Contour
public Contour(double[][] z)
Constructor.- Parameters:
z- the data matrix to create contour plot.
-
Contour
public Contour(double[][] z, int numLevels)Constructor.- Parameters:
z- the data matrix to create contour plot.numLevels- the number of contour levels.
-
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[][] z, double[] levels, java.awt.Color[] colors)Constructor.- Parameters:
z- the data matrix to create contour plot.levels- the level values of contours.colors- the color for each contour level.
-
Contour
public Contour(double[] x, double[] y, double[][] z)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.
-
Contour
public Contour(double[] x, double[] y, double[][] z, int numLevels)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.
-
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.
-
Contour
public Contour(double[] x, double[] y, double[][] z, double[] levels, java.awt.Color[] colors)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.colors- the color for each contour level.
-
-
Method Detail
-
showLevelValue
public void showLevelValue(boolean b)
Set if show the level value with each contour line.
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.
-
plot
public static PlotCanvas plot(double[][] z)
Create a plot canvas with the contour plot of given data.- Parameters:
z- a matrix.
-
plot
public static PlotCanvas plot(double[][] z, double[] levels, java.awt.Color[] palette)
Create a plot canvas with the contour plot of given data.- Parameters:
z- a matrix.
-
plot
public static PlotCanvas plot(double[] x, double[] y, double[][] z)
Create a plot canvas with the contour plot of given data.- Parameters:
z- a matrix.
-
plot
public static PlotCanvas plot(double[] x, double[] y, double[][] z, double[] levels, java.awt.Color[] palette)
Create a plot canvas with the contour plot of given data.- Parameters:
z- a matrix.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG