private void init() {
    double[][] cdf = new double[2][m + 1];
    double[][] density = new double[2][m + 1];
    double h = (b - a) / m;
    double x;
    int coex = 0;

    try {
      for (int i = 0; i <= m; i++) {
        x = a + i * h;
        cdf[0][i] = x;
        cdf[1][i] = dist.cdf(x);
      }
      cdfChart = new XYLineChart("cdf: " + dist.toString(), "", "", cdf);
    } catch (UnsupportedOperationException e) {
      coex++;
      System.err.println(e);
      //         e.printStackTrace();
    }

    try {
      for (int i = 0; i <= m; i++) {
        x = a + i * h;
        density[0][i] = x;
        density[1][i] = dist.density(x);
      }
      densityChart = new XYLineChart("density: " + dist.toString(), "", "", density);
    } catch (UnsupportedOperationException e) {
      System.err.println(e);
      if (coex == 1) throw e;
    }
    cdfChart.setprobFlag(true);
    densityChart.setprobFlag(true);
  }