From e73fcac5213a75fd981d28efd518d3dcc80ed14f Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 26 Feb 2016 09:43:28 +0000 Subject: [PATCH] [latent plots] legend was always plotted --- GPy/plotting/gpy_plot/latent_plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPy/plotting/gpy_plot/latent_plots.py b/GPy/plotting/gpy_plot/latent_plots.py index ed12ad9a..40ad0251 100644 --- a/GPy/plotting/gpy_plot/latent_plots.py +++ b/GPy/plotting/gpy_plot/latent_plots.py @@ -188,7 +188,7 @@ def plot_magnification(self, labels=None, which_indices=None, _, _, Xgrid, _, _, xmin, xmax, resolution = helper_for_plot_data(self, X, plot_limits, which_indices, None, resolution) canvas, imshow_kwargs = pl().new_canvas(xlim=(xmin[0], xmax[0]), ylim=(xmin[1], xmax[1]), xlabel='latent dimension %i' % input_1, ylabel='latent dimension %i' % input_2, **imshow_kwargs) - if (labels is not None): + if (labels is not None) and legend: legend = find_best_layout_for_subplots(len(np.unique(labels)))[1] else: labels = np.ones(self.num_data) @@ -254,7 +254,7 @@ def plot_latent(self, labels=None, which_indices=None, _, _, Xgrid, _, _, xmin, xmax, resolution = helper_for_plot_data(self, X, plot_limits, which_indices, None, resolution) canvas, imshow_kwargs = pl().new_canvas(xlim=(xmin[0], xmax[0]), ylim=(xmin[1], xmax[1]), xlabel='latent dimension %i' % input_1, ylabel='latent dimension %i' % input_2, **imshow_kwargs) - if (labels is not None): + if (labels is not None) and legend: legend = find_best_layout_for_subplots(len(np.unique(labels)))[1] else: labels = np.ones(self.num_data)