code: public static PlotCanvas plot(String[] rowLabels, String[] columnLabels, double[][] z, Color[] palette) {
          if (z.length != rowLabels.length || z[0].length != columnLabels.length) {
              throw new IllegalArgumentException("Data size and label size don't match.");
          }
  
          double[] lowerBound = {0, 0};
          double[] upperBound = {z[0].length, z.length};
          PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false);
          canvas.add(new Heatmap(rowLabels, columnLabels, z, palette));
  
          canvas.getAxis(0).setFrameVisible(false);
          canvas.getAxis(0).setGridVisible(false);
          canvas.getAxis(0).setRotation(-Math.PI / 2);
          canvas.getAxis(1).setFrameVisible(false);
          canvas.getAxis(1).setGridVisible(false);
  
          double[] locations = new double[rowLabels.length];
          for (int i = 0; i < rowLabels.length; i++) {
              locations[i] = z.length - i - 0.5;
          }
          canvas.getAxis(1).addLabel(rowLabels, locations);
  
          locations = new double[columnLabels.length];
          for (int i = 0; i < columnLabels.length; i++) {
              locations[i] = i + 0.5;
          }
          canvas.getAxis(0).addLabel(columnLabels, locations);
  
          return canvas;
      }
docs: Create a plot canvas with the pseudo heat map plot of given data.
  @param z a data matrix to be shown in pseudo heat map.
  @param rowLabels the labels for rows of data matrix.
  @param columnLabels the labels for columns of data matrix.
  @param palette the color palette.