Package smile.plot.swing
Class Hexmap
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.Hexmap
Hexmap is a variant of heat map by replacing rectangle cells with hexagon cells.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The lambda interface to retrieve the tooltip of cell. -
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 Hexmap
of
(double[][] z) Creates a hexmap with 16-color jet color palette.static Hexmap
of
(double[][] z, int k) Creates a hexmap with the jet color palette.static Hexmap
Constructor.void
Draws the shape.tooltip
(double[] coord) Returns an optional tooltip for the object at given coordinates.
-
Constructor Details
-
Hexmap
Constructor.- Parameters:
z
- a data matrix to be shown in hexmap.palette
- the color palette.tooltip
- the lambda to return the description of cells.
-
-
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
Creates a hexmap with 16-color jet color palette.- Parameters:
z
- a data matrix to be shown in hexmap.
-
of
Creates a hexmap with the jet color palette.- Parameters:
z
- a data matrix to be shown in hexmap.k
- the number of colors in the palette.
-
of
Constructor.- Parameters:
z
- a data matrix to be shown in hexmap.palette
- the color palette.
-