diff --git a/GPy/plotting/matplot_dep/latent_space_visualizations/controllers/imshow_controller.py b/GPy/plotting/matplot_dep/latent_space_visualizations/controllers/imshow_controller.py index 66c9a018..87f7df7b 100644 --- a/GPy/plotting/matplot_dep/latent_space_visualizations/controllers/imshow_controller.py +++ b/GPy/plotting/matplot_dep/latent_space_visualizations/controllers/imshow_controller.py @@ -22,8 +22,8 @@ class ImshowController(BufferedAxisChangedController): """ super(ImshowController, self).__init__(ax, plot_function, plot_limits, resolution, update_lim, **kwargs) - def _init_view(self, ax, X, xmin, xmax, ymin, ymax, **kwargs): - return ax.imshow(X, extent=(xmin, xmax, + def _init_view(self, canvas, X, xmin, xmax, ymin, ymax, **kwargs): + return pl.imshow(canvas, X, extent=(xmin, xmax, ymin, ymax), vmin=X.min(), vmax=X.max(), diff --git a/GPy/plotting/matplot_dep/plot_definitions.py b/GPy/plotting/matplot_dep/plot_definitions.py index df75b839..174d0cd3 100644 --- a/GPy/plotting/matplot_dep/plot_definitions.py +++ b/GPy/plotting/matplot_dep/plot_definitions.py @@ -161,13 +161,19 @@ class MatplotlibPlots(AbstractPlottingLibrary): where = kwargs.pop('where') if 'where' in kwargs else None # pop interpolate, which we actually do not do here! if 'interpolate' in kwargs: kwargs.pop('interpolate') + + from itertools import tee + try: + from itertools import izip as zip + except ImportError: + # python 3 already is izip + pass - from itertools import tee, izip def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) next(b, None) - return izip(a, b) + return zip(a, b) polycol = [] for y1, y2 in pairwise(percentiles): diff --git a/GPy/testing/plotting_tests.py b/GPy/testing/plotting_tests.py index 90d1f264..3f8da666 100644 --- a/GPy/testing/plotting_tests.py +++ b/GPy/testing/plotting_tests.py @@ -28,9 +28,8 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #=============================================================================== import numpy as np -import GPy, os, sys +import GPy, os from nose import SkipTest -import unittest from matplotlib.testing.compare import compare_images try: @@ -48,20 +47,12 @@ def _image_directories(func): Create the result directory if it doesn't exist. """ module_name = func.__module__ - - path = module_name - mods = module_name.split('.') - subdir = os.path.join(*mods) - basedir = os.path.join(*mods) - result_dir = os.path.join(basedir, 'testresult') baseline_dir = os.path.join(basedir, 'baseline') - if not os.path.exists(result_dir): cbook.mkdirs(result_dir) - return baseline_dir, result_dir