public static void main(String[] args) { // First, the data needed to create the JHeatMap are created: the matrix // data and two arrays with the names of the columns and rows. double[][] data = { {1, 2, 3, 4, 5}, {6, 7, 8, 9, NaN}, {10, 11, 12, 13, 14}, }; String[] rowNames = { "R1", "R2", "R3" }; String[] columnNames = { "C1", "C2", "C3", "C4", "C5" }; // Then, the JHeatMap component using the data created before is // instantiated. Note that it can also be instantiated with a // JHeatMapModel, which takes the same data than this constructor. JHeatMap heatmap = new JHeatMap(data, rowNames, columnNames); // And finally, the heatmap panel is shown. showComponent(heatmap, "JHeatMap demo"); } }
JHeatMap heatmap = new JHeatMap(heatmapModel);