smile.plot
Class Heatmap
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.Heatmap
-
public class Heatmap extends Plot
A heat map is a graphical representation of data where the values taken by a variable in a two-dimensional map are represented as colors.
-
-
Constructor Summary
Constructors Constructor and Description Heatmap(double[][] z)Constructor.Heatmap(double[][] z, java.awt.Color[] palette)Constructor.Heatmap(double[][] z, int k)Constructor.Heatmap(double[] x, double[] y, double[][] z)Constructor.Heatmap(double[] x, double[] y, double[][] z, java.awt.Color[] palette)Constructor.Heatmap(double[] x, double[] y, double[][] z, int k)Constructor.Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z)Constructor.Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, java.awt.Color[] palette)Constructor.Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, int k)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetToolTip(double[] coord)Returns a optional tool tip for the object at given coordinates.voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(double[][] z)Create a plot canvas with the pseudo heat map plot of given data.static PlotCanvasplot(double[][] z, java.awt.Color[] palette)Create a plot canvas with the pseudo heat map plot of given data.static PlotCanvasplot(double[] x, double[] y, double[][] z)Create a plot canvas with the pseudo heat map plot of given data.static PlotCanvasplot(double[] x, double[] y, double[][] z, java.awt.Color[] palette)Create a plot canvas with the pseudo heat map plot of given data.static PlotCanvasplot(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z)Create a plot canvas with the pseudo heat map plot of given data.static PlotCanvasplot(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, java.awt.Color[] palette)Create a plot canvas with the pseudo heat map plot of given data.-
Methods inherited from class smile.plot.Plot
getID, getToolBar, setID
-
-
-
-
Constructor Detail
-
Heatmap
public Heatmap(double[][] z)
Constructor. Use 16-color jet color palette.
-
Heatmap
public Heatmap(double[][] z, int k)Constructor. Use jet color palette.- Parameters:
z- a data matrix to be shown in pseudo heat map.k- the number of colors in the palette.
-
Heatmap
public Heatmap(double[][] z, java.awt.Color[] palette)Constructor.- Parameters:
z- a data matrix to be shown in pseudo heat map.palette- the color palette.
-
Heatmap
public Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z)Constructor. Use 16-color jet color palette.
-
Heatmap
public Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, int k)Constructor. Use jet color palette.- Parameters:
z- a data matrix to be shown in pseudo heat map.k- the number of colors in the palette.
-
Heatmap
public Heatmap(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, java.awt.Color[] palette)Constructor.- Parameters:
z- a data matrix to be shown in pseudo heat map.palette- the color palette.
-
Heatmap
public Heatmap(double[] x, double[] y, double[][] z)Constructor. Use 16-color jet color palette.- Parameters:
x- x coordinate of data matrix cells. Must be in ascending order.y- y coordinate of data matrix cells. Must be in ascending order.z- a data matrix to be shown in pseudo heat map.
-
Heatmap
public Heatmap(double[] x, double[] y, double[][] z, int k)Constructor. Use jet color palette.- Parameters:
x- x coordinate of data matrix cells. Must be in ascending order.y- y coordinate of data matrix cells. Must be in ascending order.z- a data matrix to be shown in pseudo heat map.k- the number of colors in the palette.
-
Heatmap
public Heatmap(double[] x, double[] y, double[][] z, java.awt.Color[] palette)Constructor.- Parameters:
x- x coordinate of data matrix cells. Must be in ascending order.y- y coordinate of data matrix cells. Must be in ascending order.z- a data matrix to be shown in pseudo heat map.palette- the color palette.
-
-
Method Detail
-
getToolTip
public java.lang.String getToolTip(double[] coord)
Description copied from class:PlotReturns a optional tool tip for the object at given coordinates.- Overrides:
getToolTipin classPlot- Parameters:
coord- the logical coordinates of current mouse position.- Returns:
- a string if an object with label close to the given coordinates. Otherwise null.
-
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 pseudo heat map plot of given data.- Parameters:
z- a data matrix to be shown in pseudo heat map.
-
plot
public static PlotCanvas plot(double[][] z, java.awt.Color[] palette)
Create a plot canvas with the pseudo heat map plot of given data.- Parameters:
z- a data matrix to be shown in pseudo heat map.palette- the color palette.
-
plot
public static PlotCanvas plot(double[] x, double[] y, double[][] z)
Create a plot canvas with the pseudo heat map plot of given data.- Parameters:
x- x coordinate of data matrix cells. Must be in ascending order.y- y coordinate of data matrix cells. Must be in ascending order.z- a data matrix to be shown in pseudo heat map.
-
plot
public static PlotCanvas plot(double[] x, double[] y, double[][] z, java.awt.Color[] palette)
Create a plot canvas with the pseudo heat map plot of given data.- Parameters:
x- x coordinate of data matrix cells. Must be in ascending order.y- y coordinate of data matrix cells. Must be in ascending order.z- a data matrix to be shown in pseudo heat map.palette- the color palette.
-
plot
public static PlotCanvas plot(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z)
Create a plot canvas with the pseudo heat map plot of given data.- Parameters:
z- a data matrix to be shown in pseudo heat map.rowLabels- the labels for rows of data matrix.columnLabels- the labels for columns of data matrix.
-
plot
public static PlotCanvas plot(java.lang.String[] rowLabels, java.lang.String[] columnLabels, double[][] z, java.awt.Color[] palette)
Create a plot canvas with the pseudo heat map plot of given data.- Parameters:
z- a data matrix to be shown in pseudo heat map.rowLabels- the labels for rows of data matrix.columnLabels- the labels for columns of data matrix.palette- the color palette.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG