errorbars fixed

This commit is contained in:
Ricardo 2015-09-03 17:30:16 +01:00
parent 1e45a7cddd
commit 6e76a96d77
2 changed files with 9 additions and 8 deletions

View file

@ -613,9 +613,9 @@ class GP(Model):
fignum, ax, data_symbol, **kw) fignum, ax, data_symbol, **kw)
def plot_fit_errorbars(self, which_data_rows='all', def errorbars_trainset(self, which_data_rows='all',
which_data_ycols='all', fixed_inputs=[], fignum=None, ax=None, which_data_ycols='all', fixed_inputs=[], fignum=None, ax=None,
linecol=None, data_symbol='kx', predict_kw=None, plot_training_data=True): linecol=None, data_symbol='kx', predict_kw=None, plot_training_data=True,lw=None):
""" """
Plot the posterior error bars corresponding to the training data Plot the posterior error bars corresponding to the training data
@ -640,7 +640,9 @@ class GP(Model):
assert "matplotlib" in sys.modules, "matplotlib package has not been imported." assert "matplotlib" in sys.modules, "matplotlib package has not been imported."
from ..plotting.matplot_dep import models_plots from ..plotting.matplot_dep import models_plots
kw = {} kw = {}
return models_plots.plot_fit_errorbars(self, which_data_rows, which_data_ycols, fixed_inputs, if lw is not None:
kw['lw'] = lw
return models_plots.errorbars_trainset(self, which_data_rows, which_data_ycols, fixed_inputs,
fignum, ax, linecol, data_symbol, fignum, ax, linecol, data_symbol,
predict_kw, plot_training_data, **kw) predict_kw, plot_training_data, **kw)

View file

@ -330,11 +330,11 @@ def fixed_inputs(model, non_fixed_inputs, fix_routine='median', as_list=True, X_
return X return X
def plot_fit_errorbars(model, which_data_rows='all', def errorbars_trainset(model, which_data_rows='all',
which_data_ycols='all', fixed_inputs=[], which_data_ycols='all', fixed_inputs=[],
fignum=None, ax=None, fignum=None, ax=None,
linecol='red', data_symbol='kx', linecol='red', data_symbol='kx',
predict_kw=None, plot_training_data=True): predict_kw=None, plot_training_data=True, **kwargs):
""" """
Plot the posterior error bars corresponding to the training data Plot the posterior error bars corresponding to the training data
@ -386,9 +386,8 @@ def plot_fit_errorbars(model, which_data_rows='all',
fmu, fv = model._raw_predict(X, full_cov=False, **predict_kw) fmu, fv = model._raw_predict(X, full_cov=False, **predict_kw)
lower, upper = model.likelihood.predictive_quantiles(fmu, fv, (2.5, 97.5), Y_metadata=model.Y_metadata) lower, upper = model.likelihood.predictive_quantiles(fmu, fv, (2.5, 97.5), Y_metadata=model.Y_metadata)
for d in which_data_ycols: for d in which_data_ycols:
plots['gperrors'] = gperrors(X, m[:, d], lower[:, d], upper[:, d], edgecol=linecol, ax=ax, fignum=fignum ) plots['gperrors'] = gperrors(X, m[:, d], lower[:, d], upper[:, d], edgecol=linecol, ax=ax, fignum=fignum, **kwargs )
if plot_training_data: if plot_training_data:
plots['dataplot'] = plot_data(model=model, which_data_rows=which_data_rows, plots['dataplot'] = plot_data(model=model, which_data_rows=which_data_rows,
visible_dims=free_dims, data_symbol=data_symbol, mew=1.5, ax=ax, fignum=fignum) visible_dims=free_dims, data_symbol=data_symbol, mew=1.5, ax=ax, fignum=fignum)