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
    • getUpperBound

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

      public void paint(Graphics g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
    • canvas

      public Canvas canvas()
      Description copied from class: Plot
      Returns a canvas of the plot.
      Overrides:
      canvas in class 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.
    • 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.
    • of

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