def plot_covariance(kernel, x=None, label=None,<EOL>plot_limits=None, visible_dims=None, resolution=None,<EOL>projection='<STR_LIT>', levels=<NUM_LIT:20>, **kwargs):
X = np.ones((<NUM_LIT:2>, kernel._effective_input_dim)) * [[-<NUM_LIT:3>], [<NUM_LIT:3>]]<EOL>_, free_dims, Xgrid, xx, yy, _, _, resolution = helper_for_plot_data(kernel, X, plot_limits, visible_dims, None, resolution)<EOL>from numbers import Number<EOL>if x is None:<EOL><INDENT>from ...kern.src.stationary import Stationary<EOL>x = np.ones((<NUM_LIT:1>, kernel._effective_input_dim)) * (not isinstance(kernel, Stationary))<EOL><DEDENT>elif isinstance(x, Number):<EOL><INDENT>x = np.ones((<NUM_LIT:1>, kernel._effective_input_dim))*x<EOL><DEDENT>K = kernel.K(Xgrid, x)<EOL>if projection == '<STR_LIT>':<EOL><INDENT>xlabel = '<STR_LIT>'<EOL>ylabel = '<STR_LIT>'<EOL>zlabel = "<STR_LIT>".format(np.asanyarray(x).tolist())<EOL><DEDENT>else:<EOL><INDENT>xlabel = '<STR_LIT:X>'<EOL>ylabel = "<STR_LIT>".format(np.asanyarray(x).tolist())<EOL>zlabel = None<EOL><DEDENT>canvas, kwargs = pl().new_canvas(projection=projection, xlabel=xlabel, ylabel=ylabel, zlabel=zlabel, **kwargs)<EOL>if len(free_dims)<=<NUM_LIT:2>:<EOL><INDENT>if len(free_dims)==<NUM_LIT:1>:<EOL><INDENT>update_not_existing_kwargs(kwargs, pl().defaults.meanplot_1d)  <EOL>plots = dict(covariance=[pl().plot(canvas, Xgrid[:, free_dims], K, label=label, **kwargs)])<EOL><DEDENT>else:<EOL><INDENT>if projection == '<STR_LIT>':<EOL><INDENT>update_not_existing_kwargs(kwargs, pl().defaults.meanplot_2d)  <EOL>plots = dict(covariance=[pl().contour(canvas, xx[:, <NUM_LIT:0>], yy[<NUM_LIT:0>, :],<EOL>K.reshape(resolution, resolution),<EOL>levels=levels, label=label, **kwargs)])<EOL><DEDENT>elif projection == '<STR_LIT>':<EOL><INDENT>update_not_existing_kwargs(kwargs, pl().defaults.meanplot_3d)  <EOL>plots = dict(covariance=[pl().surface(canvas, xx, yy,<EOL>K.reshape(resolution, resolution),<EOL>label=label,<EOL>**kwargs)])<EOL><DEDENT><DEDENT>return pl().add_to_canvas(canvas, plots)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>")<EOL><DEDENT>
Plot a kernel covariance w.r.t. another x.

:param array-like x: the value to use for the other kernel argument (kernels are a function of two variables!)
:param plot_limits: the range over which to plot the kernel
:type plot_limits: Either (xmin, xmax) for 1D or (xmin, xmax, ymin, ymax) / ((xmin, xmax), (ymin, ymax)) for 2D
:param array-like visible_dims: input dimensions (!) to use for x. Make sure to select 2 or less dimensions to plot.
:resolution: the resolution of the lines used in plotting. for 2D this defines the grid for kernel evaluation.
:param {2d|3d} projection: What projection shall we use to plot the kernel?
:param int levels: for 2D projection, how many levels for the contour plot to use?
:param kwargs:  valid kwargs for your specific plotting library