From ecfffc97e66fb85f4fe698037a43150fb906c25a Mon Sep 17 00:00:00 2001 From: James Hensman Date: Mon, 28 Oct 2013 22:11:08 +0000 Subject: [PATCH] even more data plotting --- GPy/core/gp_base.py | 2 +- GPy/core/sparse_gp.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GPy/core/gp_base.py b/GPy/core/gp_base.py index f07c4b96..10d30358 100644 --- a/GPy/core/gp_base.py +++ b/GPy/core/gp_base.py @@ -190,7 +190,7 @@ class GPBase(Model): #ax.plot(Xnew, yi[:,None], marker='x', linestyle='--',color=Tango.colorsHex['darkBlue']) #TODO apply this line for discrete outputs. #set the limits of the plot to some sensible values - ymin, ymax = min(np.append(self.likelihood.data, lower)), max(np.append(self.likelihood.data, upper)) + ymin, ymax = min(np.append(Y[which_data_rows, which_data_ycols].flatten(), lower)), max(np.append(Y[which_data_rows, which_data_ycols].flatten(), upper)) ymin, ymax = ymin - 0.1 * (ymax - ymin), ymax + 0.1 * (ymax - ymin) ax.set_xlim(xmin, xmax) ax.set_ylim(ymin, ymax) diff --git a/GPy/core/sparse_gp.py b/GPy/core/sparse_gp.py index e02da768..5e381110 100644 --- a/GPy/core/sparse_gp.py +++ b/GPy/core/sparse_gp.py @@ -324,7 +324,7 @@ class SparseGP(GPBase): def plot_f(self, samples=0, plot_limits=None, which_data_rows='all', - which_data_cols='all', which_parts='all', resolution=None, + which_data_ycols='all', which_parts='all', resolution=None, full_cov=False, fignum=None, ax=None): """ @@ -359,7 +359,7 @@ class SparseGP(GPBase): if which_data_rows is 'all': which_data_rows = slice(None) - GPBase.plot_f(self, samples=samples, plot_limits=plot_limits, which_data_rows=which_data_rows, which_data_ycols=which_data_ycols, which_parts=which_parts, resolution=resolution, full_cov=full_cov, fignum=fignum, ax=ax) + GPBase.plot_f(self, samples=samples, plot_limits=plot_limits, which_data_rows=which_data_rows, which_data_ycols=which_data_ycols, which_parts=which_parts, resolution=resolution, fignum=fignum, ax=ax) if self.X.shape[1] == 1: if self.has_uncertain_inputs: @@ -379,6 +379,7 @@ class SparseGP(GPBase): def plot(self, plot_limits=None, which_data_rows='all', which_data_ycols='all', which_parts='all', fixed_inputs=[], + plot_raw=False, levels=20, samples=0, fignum=None, ax=None, resolution=None): """ Plot the posterior of the sparse GP.