def plot_mapping(self, plot_limits=None, which_data='<STR_LIT:all>', which_parts='<STR_LIT:all>', resolution=None, levels=<NUM_LIT:20>, samples=<NUM_LIT:0>, fignum=None, ax=None, fixed_inputs=[], linecol=Tango.colorsHex['<STR_LIT>']):
<EOL>if which_data == '<STR_LIT:all>':<EOL><INDENT>which_data = slice(None)<EOL><DEDENT>if ax is None:<EOL><INDENT>fig = pb.figure(num=fignum)<EOL>ax = fig.add_subplot(<NUM_LIT>)<EOL><DEDENT>plotdims = self.input_dim - len(fixed_inputs)<EOL>from ..gpy_plot.plot_util import x_frame1D, x_frame2D<EOL>if plotdims == <NUM_LIT:1>:<EOL><INDENT>Xu = self.X * self._Xscale + self._Xoffset <EOL>fixed_dims = np.array([i for i,v in fixed_inputs])<EOL>freedim = np.setdiff1d(np.arange(self.input_dim),fixed_dims)<EOL>Xnew, xmin, xmax = x_frame1D(Xu[:,freedim], plot_limits=plot_limits)<EOL>Xgrid = np.empty((Xnew.shape[<NUM_LIT:0>],self.input_dim))<EOL>Xgrid[:,freedim] = Xnew<EOL>for i,v in fixed_inputs:<EOL><INDENT>Xgrid[:,i] = v<EOL><DEDENT>f = self.predict(Xgrid, which_parts=which_parts)<EOL>for d in range(y.shape[<NUM_LIT:1>]):<EOL><INDENT>ax.plot(Xnew, f[:, d], edgecol=linecol)<EOL><DEDENT><DEDENT>elif self.X.shape[<NUM_LIT:1>] == <NUM_LIT:2>:<EOL><INDENT>resolution = resolution or <NUM_LIT:50><EOL>Xnew, _, _, xmin, xmax = x_frame2D(self.X, plot_limits, resolution)<EOL>x, y = np.linspace(xmin[<NUM_LIT:0>], xmax[<NUM_LIT:0>], resolution), np.linspace(xmin[<NUM_LIT:1>], xmax[<NUM_LIT:1>], resolution)<EOL>f = self.predict(Xnew, which_parts=which_parts)<EOL>m = m.reshape(resolution, resolution).T<EOL>ax.contour(x, y, f, levels, vmin=m.min(), vmax=m.max(), cmap=pb.cm.jet) <EOL>ax.set_xlim(xmin[<NUM_LIT:0>], xmax[<NUM_LIT:0>])<EOL>ax.set_ylim(xmin[<NUM_LIT:1>], xmax[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>")<EOL><DEDENT>
Plots the mapping associated with the model.
  - In one dimension, the function is plotted.
  - In two dimsensions, a contour-plot shows the function
  - In higher dimensions, we've not implemented this yet !TODO!

Can plot only part of the data and part of the posterior functions
using which_data and which_functions

:param plot_limits: The limits of the plot. If 1D [xmin,xmax], if 2D [[xmin,ymin],[xmax,ymax]]. Defaluts to data limits
:type plot_limits: np.array
:param which_data: which if the training data to plot (default all)
:type which_data: 'all' or a slice object to slice self.X, self.Y
:param which_parts: which of the kernel functions to plot (additively)
:type which_parts: 'all', or list of bools
:param resolution: the number of intervals to sample the GP on. Defaults to 200 in 1D and 50 (a 50x50 grid) in 2D
:type resolution: int
:param levels: number of levels to plot in a contour plot.
:type levels: int
:param samples: the number of a posteriori samples to plot
:type samples: int
:param fignum: figure to plot on.
:type fignum: figure number
:param ax: axes to plot on.
:type ax: axes handle
:param fixed_inputs: a list of tuple [(i,v), (i,v)...], specifying that input index i should be set to value v.
:type fixed_inputs: a list of tuples
:param linecol: color of line to plot.
:type linecol:
:param levels: for 2D plotting, the number of contour levels to use is ax is None, create a new figure