Package smile.plot.swing
Class Heatmap
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.Heatmap
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
-
Method Summary
Modifier and TypeMethodDescriptioncanvas()
Returns a canvas of the plot.double[]
Returns the lower bound of data.double[]
Returns the upper bound of data.static Heatmap
of
(double[][] z) Constructor.static Heatmap
of
(double[][] z, int k) Creates a heatmap with jet color palette.static Heatmap
Constructor.static Heatmap
of
(double[] x, double[] y, double[][] z) Constructor.static Heatmap
of
(double[] x, double[] y, double[][] z, int k) Constructor.static Heatmap
Constructor.static Heatmap
Constructor.void
Draws the shape.tooltip
(double[] coord) Returns an optional tooltip for the object at given coordinates.
-
Constructor Details
-
Heatmap
Constructor.- Parameters:
rowLabels
- the labels of rows.columnLabels
- the labels of columns.z
- a data matrix to be shown in pseudo heat map.palette
- the color palette.
-
Heatmap
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 Details
-
tooltip
Description copied from class:Plot
Returns an optional tooltip for the object at given coordinates. -
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. -
canvas
Description copied from class:Plot
Returns a canvas of the plot. -
of
Constructor. Use 16-color jet color palette. -
of
Creates a heatmap with jet color palette.- Parameters:
z
- a data matrix to be shown in pseudo heat map.k
- the number of colors in the palette.
-
of
Constructor.- Parameters:
z
- a data matrix to be shown in pseudo heat map.palette
- the color palette.
-
of
Constructor. Use 16-color jet color palette. -
of
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.
-
of
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.
-
of
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.
-