def plot_ARD(kernel, filtering=None, legend=False, canvas=None, **kwargs):
Tango.reset()<EOL>ard_params = np.atleast_2d(kernel.input_sensitivity(summarize=False))<EOL>bottom = <NUM_LIT:0><EOL>last_bottom = bottom<EOL>x = np.arange(kernel._effective_input_dim)<EOL>parts = []<EOL>def visit(x):<EOL><INDENT>if (not isinstance(x, CombinationKernel)) and isinstance(x, Kern):<EOL><INDENT>parts.append(x)<EOL><DEDENT><DEDENT>kernel.traverse(visit)<EOL>if filtering is None:<EOL><INDENT>filtering = [k.name for k in parts]<EOL><DEDENT>bars = []<EOL>kwargs = update_not_existing_kwargs(kwargs, pl().defaults.ard)<EOL>if canvas is None:<EOL><INDENT>canvas, kwargs = pl().new_canvas(xlim=(-<NUM_LIT>, kernel._effective_input_dim-<NUM_LIT>), xlabel='<STR_LIT>', ylabel='<STR_LIT>', **kwargs)<EOL><DEDENT>for i in range(ard_params.shape[<NUM_LIT:0>]):<EOL><INDENT>if parts[i].name in filtering:<EOL><INDENT>c = Tango.nextMedium()<EOL>bars.append(pl().barplot(canvas, x,<EOL>ard_params[i,:], color=c,<EOL>label=parts[i].name,<EOL>bottom=bottom, **kwargs))<EOL>last_bottom = ard_params[i,:]<EOL>bottom += last_bottom<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>".format(parts[i].name))<EOL><DEDENT><DEDENT>return pl().add_to_canvas(canvas, bars, legend=legend)<EOL>
If an ARD kernel is present, plot a bar representation using matplotlib

:param fignum: figure number of the plot
:param filtering: list of names, which to use for plotting ARD parameters.
                  Only kernels which match names in the list of names in filtering
                  will be used for plotting.
:type filtering: list of names to use for ARD plot