Class Hexmap


public class Hexmap extends Plot
Hexmap is a variant of heat map by replacing rectangle cells with hexagon cells.
  • Constructor Details

    • Hexmap

      public Hexmap(double[][] z, Color[] palette, Hexmap.Tooltip tooltip)
      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

      public Optional<String> tooltip(double[] coord)
      Description copied from class: Plot
      Returns an optional tooltip for the object at given coordinates.
      Overrides:
      tooltip in class Plot
      Parameters:
      coord - the logical coordinates of current mouse position.
      Returns:
      a string if an object with label close to the given coordinates.
    • getLowerBound

      public double[] getLowerBound()
      Description copied from class: Plot
      Returns the lower bound of data.
      Specified by:
      getLowerBound in class Plot
      Returns:
      the lower bound of data.
    • getUpperBound

      public double[] getUpperBound()
      Description copied from class: Plot
      Returns the upper bound of data.
      Specified by:
      getUpperBound in class Plot
      Returns:
      the upper bound of data.
    • paint

      public void paint(Renderer g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
      Parameters:
      g - the renderer.
    • figure

      public Figure figure()
      Description copied from class: Plot
      Returns a figure containing the plot.
      Overrides:
      figure in class Plot
      Returns:
      a figure containing the plot.
    • of

      public static Hexmap of(double[][] z)
      Creates a hexmap with 16-color jet color palette.
      Parameters:
      z - a data matrix to be shown in hexmap.
      Returns:
      the hexmap.
    • of

      public static Hexmap of(double[][] z, int k)
      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.
      Returns:
      the hexmap.
    • of

      public static Hexmap of(double[][] z, Color[] palette)
      Creates a hexmap with given color palette.
      Parameters:
      z - a data matrix to be shown in hexmap.
      palette - the color palette.
      Returns:
      the hexmap.