From 3fb98d09f796ddc62c11b6c8b6b0c62f67c72019 Mon Sep 17 00:00:00 2001 From: Eric <31961027+frsnjung@users.noreply.github.com> Date: Mon, 15 Jan 2018 11:14:12 +0100 Subject: [PATCH] UMatrixView save figure fix Fixes the "AttributeError: 'NoneType' object has no attribute 'savefig'" when using the MatplotView.save() method on a UMatrixView object. --- sompy/visualization/umatrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sompy/visualization/umatrix.py b/sompy/visualization/umatrix.py index afa8ae8..6665401 100644 --- a/sompy/visualization/umatrix.py +++ b/sompy/visualization/umatrix.py @@ -35,7 +35,7 @@ def show(self, som, distance2=1, row_normalized=False, show_data=True, proj = som.project_data(som.data_raw) coord = som.bmu_ind_to_xy(proj) - fig, ax = plt.subplots(1, 1) + self._fig, ax = plt.subplots(1, 1) imshow(umat, cmap=plt.cm.get_cmap('RdYlBu_r'), alpha=1) if contooor: @@ -61,7 +61,7 @@ def show(self, som, distance2=1, row_normalized=False, show_data=True, verticalalignment='center') ratio = float(msz[0])/(msz[0]+msz[1]) - fig.set_size_inches((1-ratio)*15, ratio*15) + self._fig.set_size_inches((1-ratio)*15, ratio*15) plt.tight_layout() plt.subplots_adjust(hspace=.00, wspace=.000) sel_points = list()