def _plot_density(self, canvas, helper_data, helper_prediction, label, **kwargs):
    _, free_dims, Xgrid, _, _, _, _, _ = helper_data
    mu, percs, _ = helper_prediction

    update_not_existing_kwargs(kwargs, pl().defaults.density)  # @UndefinedVariable

    if len(free_dims)<=1:
        if len(free_dims)==1:
            # 1D plotting:
            fills = []
            for d in range(mu.shape[1]):
                fills.append(pl().fill_gradient(canvas, Xgrid[:, free_dims[0]], [p[:,d] for p in percs], label=label, **kwargs))
            return dict(gpdensity=fills)
        else:
            pass # Nothing to plot!
    else:
        raise RuntimeError('Can only plot density in one input dimension')
dataset/ETHPy150Open SheffieldML/GPy/GPy/plotting/gpy_plot/gp_plots.py/_plot_density/original