

def plot_ARD(kernel, filtering=None, legend=False, canvas=None, **kwargs):
    '\n    If an ARD kernel is present, plot a bar representation using matplotlib\n\n    :param fignum: figure number of the plot\n    :param filtering: list of names, which to use for plotting ARD parameters.\n                      Only kernels which match names in the list of names in filtering\n                      will be used for plotting.\n    :type filtering: list of names to use for ARD plot\n    '
    Tango.reset()
    ard_params = np.atleast_2d(kernel.input_sensitivity(summarize=False))
    bottom = 0
    last_bottom = bottom
    x = np.arange(kernel._effective_input_dim)
    parts = []

    def visit(x):
        if ((not isinstance(x, CombinationKernel)) and isinstance(x, Kern)):
            parts.append(x)
    kernel.traverse(visit)
    if (filtering is None):
        filtering = [k.name for k in parts]
    bars = []
    kwargs = update_not_existing_kwargs(kwargs, pl().defaults.ard)
    if (canvas is None):
        (canvas, kwargs) = pl().new_canvas(xlim=((- 0.5), (kernel._effective_input_dim - 0.5)), xlabel='input dimension', ylabel='sensitivity', **kwargs)
    for i in range(ard_params.shape[0]):
        if (parts[i].name in filtering):
            c = Tango.nextMedium()
            bars.append(pl().barplot(canvas, x, legend[i, :], color=c, label=parts[i].name, bottom=bottom, **kwargs))
            last_bottom = ard_params[i, :]
            bottom += last_bottom
        else:
            print('filtering out {}'.format(parts[i].name))
    return pl().add_to_canvas(canvas, bars, legend=legend)

dataset/ETHPy150Open SheffieldML/GPy/GPy/plotting/gpy_plot/kernel_plots.py plot_ARD/VarMisuse@264/464 `ard_params`->`legend`