smile.plot
Class Hexmap
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.Hexmap
-
public class Hexmap extends Plot
Hexmap is a variant of heat map by replacing rectangle cells with hexagon cells.
-
-
Constructor Summary
Constructors Constructor and Description Hexmap(double[][] z)Constructor.Hexmap(double[][] z, java.awt.Color[] palette)Constructor.Hexmap(double[][] z, int k)Constructor.Hexmap(java.lang.String[][] labels, double[][] z)Constructor.Hexmap(java.lang.String[][] labels, double[][] z, java.awt.Color[] palette)Constructor.Hexmap(java.lang.String[][] labels, double[][] z, int k)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetToolTip(double[] coord)Returns a optional tool tip for the object at given coordinates.voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(double[][] data)Create a plot canvas with the pseudo hexmap plot of given data.static PlotCanvasplot(double[][] data, java.awt.Color[] palette)Create a plot canvas with the pseudo hexmap plot of given data.static PlotCanvasplot(java.lang.String[][] labels, double[][] data)Create a plot canvas with the pseudo hexmap plot of given data.static PlotCanvasplot(java.lang.String[][] labels, double[][] data, java.awt.Color[] palette)Create a plot canvas with the pseudo hexmap plot of given data.-
Methods inherited from class smile.plot.Plot
getID, getToolBar, setID
-
-
-
-
Constructor Detail
-
Hexmap
public Hexmap(double[][] z)
Constructor. Use 16-color jet color palette.- Parameters:
z- a data matrix to be shown in hexmap.
-
Hexmap
public Hexmap(double[][] z, int k)Constructor. Use jet color palette.- Parameters:
z- a data matrix to be shown in hexmap.k- the number of colors in the palette.
-
Hexmap
public Hexmap(double[][] z, java.awt.Color[] palette)Constructor.- Parameters:
z- a data matrix to be shown in hexmap.palette- the color palette.
-
Hexmap
public Hexmap(java.lang.String[][] labels, double[][] z)Constructor. Use 16-color jet color palette.- Parameters:
labels- the descriptions of each cell in the data matrix.z- a data matrix to be shown in hexmap.
-
Hexmap
public Hexmap(java.lang.String[][] labels, double[][] z, int k)Constructor. Use jet color palette.- Parameters:
labels- the descriptions of each cell in the data matrix.z- a data matrix to be shown in hexmap.k- the number of colors in the palette.
-
Hexmap
public Hexmap(java.lang.String[][] labels, double[][] z, java.awt.Color[] palette)Constructor.- Parameters:
labels- the descriptions of each cell in the data matrix.z- a data matrix to be shown in hexmap.palette- the color palette.
-
-
Method Detail
-
getToolTip
public java.lang.String getToolTip(double[] coord)
Description copied from class:PlotReturns a optional tool tip for the object at given coordinates.- Overrides:
getToolTipin classPlot- Parameters:
coord- the logical coordinates of current mouse position.- Returns:
- a string if an object with label close to the given coordinates. Otherwise null.
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.
-
plot
public static PlotCanvas plot(double[][] data)
Create a plot canvas with the pseudo hexmap plot of given data.- Parameters:
data- a data matrix to be shown in hexmap.
-
plot
public static PlotCanvas plot(double[][] data, java.awt.Color[] palette)
Create a plot canvas with the pseudo hexmap plot of given data.- Parameters:
data- a data matrix to be shown in hexmap.palette- the color palette.
-
plot
public static PlotCanvas plot(java.lang.String[][] labels, double[][] data)
Create a plot canvas with the pseudo hexmap plot of given data.- Parameters:
labels- the descriptions of each cell in the data matrix.data- a data matrix to be shown in hexmap.
-
plot
public static PlotCanvas plot(java.lang.String[][] labels, double[][] data, java.awt.Color[] palette)
Create a plot canvas with the pseudo hexmap plot of given data.- Parameters:
labels- the descriptions of each cell in the data matrix.data- a data matrix to be shown in hexmap.palette- the color palette.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG