code: public static PlotCanvas plot(double[][] data, int xbins, int ybins, boolean prob, Color[] palette) {
          Histogram3D histogram = new Histogram3D(data, xbins, ybins, prob, palette);
  
          double[] min = Math.colMin(data);
          double[] max = Math.colMax(data);
          double[] lowerBound = {min[0], min[1], 0};
          double[] upperBound = {max[0], max[1], 0};
          double[][] freq = histogram.getHistogram();
          for (int i = 0; i < freq.length; i++) {
              if (freq[i][2] > upperBound[2]) {
                  upperBound[2] = freq[i][2];
              }
          }
  
          PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound);
          canvas.add(histogram);
  
          return canvas;
      }
docs: Create a plot canvas with the histogram plot of given data.
  @param data a sample set.
  @param xbins the number of bins on x-axis.
  @param ybins the number of bins on y-axis.
  @param prob if true, the z-axis will be in the probability scale.
  @param palette the color palette.