diff --git a/GPy/plotting/gpy_plot/gp_plots.py b/GPy/plotting/gpy_plot/gp_plots.py index 202ccfe7..c43e67d8 100644 --- a/GPy/plotting/gpy_plot/gp_plots.py +++ b/GPy/plotting/gpy_plot/gp_plots.py @@ -268,7 +268,10 @@ def _plot_density(self, canvas, helper_data, helper_prediction, label, **kwargs) # 1D plotting: fills = [] for d in range(mu.shape[1]): - fills.append(pl().fill_gradient(canvas, Xgrid[:, free_dims[0]], [p[:,d] for p in percs], label=label, **kwargs)) + fills.append(pl().fill_gradient( + canvas, Xgrid[:, free_dims[0]], [p[:,d] for p in percs], + label=label, **kwargs) + ) return dict(gpdensity=fills) else: pass # Nothing to plot! diff --git a/GPy/plotting/matplot_dep/plot_definitions.py b/GPy/plotting/matplot_dep/plot_definitions.py index 336419ae..290aa743 100644 --- a/GPy/plotting/matplot_dep/plot_definitions.py +++ b/GPy/plotting/matplot_dep/plot_definitions.py @@ -90,7 +90,7 @@ class MatplotlibPlots(AbstractPlottingLibrary): #ax.legend(prop=fontdict) legend_ontop(ax, ncol=legend, fontdict=fontdict) if title is not None: ax.figure.suptitle(title) - return ax + return plots def show_canvas(self, ax, **kwargs): ax.figure.canvas.draw() @@ -298,7 +298,7 @@ class MatplotlibPlots(AbstractPlottingLibrary): from matplotlib.collections import PolyCollection if 'zorder' not in kwargs: kwargs['zorder'] = 0 - plots.append(PolyCollection(polycol, **kwargs)) + plots.append(PolyCollection(polycol, label=label, **kwargs)) ax.add_collection(plots[-1], autolim=True) ax.autoscale_view() return plots