Skip to content

Commit

Permalink
UMatrixView save figure fix
Browse files Browse the repository at this point in the history
Fixes the "AttributeError: 'NoneType' object has no attribute 'savefig'" when using the MatplotView.save() method on a UMatrixView object.
  • Loading branch information
frsnjung authored Jan 15, 2018
1 parent e07aae2 commit 3fb98d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sompy/visualization/umatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit 3fb98d0

Please sign in to comment.