public class Hexmap extends Plot
Modifier and Type | Class and Description |
---|---|
static interface |
Hexmap.Tooltip
The lambda interface to retrieve the tooltip of cell.
|
Constructor and Description |
---|
Hexmap(double[][] z,
java.awt.Color[] palette,
Hexmap.Tooltip tooltip)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Canvas |
canvas()
Returns a canvas of the plot.
|
double[] |
getLowerBound()
Returns the lower bound of data.
|
double[] |
getUpperBound()
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,
java.awt.Color[] palette)
Constructor.
|
static Hexmap |
of(double[][] z,
int k)
Creates a hexmap with the jet color palette.
|
void |
paint(Graphics g)
Draws the shape.
|
java.util.Optional<java.lang.String> |
tooltip(double[] coord)
Returns a optional tool tip for the object at given coordinates.
|
public Hexmap(double[][] z, java.awt.Color[] palette, Hexmap.Tooltip tooltip)
z
- a data matrix to be shown in hexmap.palette
- the color palette.tooltip
- the lambda to return the description of cells.public java.util.Optional<java.lang.String> tooltip(double[] coord)
Plot
public double[] getLowerBound()
Plot
getLowerBound
in class Plot
public double[] getUpperBound()
Plot
getUpperBound
in class Plot
public static Hexmap of(double[][] z)
z
- a data matrix to be shown in hexmap.public static Hexmap of(double[][] z, int k)
z
- a data matrix to be shown in hexmap.k
- the number of colors in the palette.public static Hexmap of(double[][] z, java.awt.Color[] palette)
z
- a data matrix to be shown in hexmap.palette
- the color palette.