I\'m trying to plot a seaborn clustermap (it doesn\'t work with the heatmap too) with the following, no NaNs admitted:
import nump
I'm using Mac OS X 10.9.5, python 2.7.9, matplotlib 1.4.3, and seaborn 0.5.1. I was able to reproduce the error.
By default I am using the macosx
backend for matplotlib. Your code works if I change the backend to qt4agg
(requires PyQt4), tkagg
or webagg
. Here's the script that worked for me:
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('qt4agg') # Can also use 'tkagg' or 'webagg'
import matplotlib.pyplot as plt
import seaborn as sns
def plotClusterMap():
a = pd.DataFrame(np.matrix('1 2; 3 4'))
print a
# fig = plt.figure()
sns.clustermap(a)
plt.show()
if __name__ == "__main__":
plotClusterMap()
Note that I commented out fig = plt.figure()
. clustermap
appears to create its own figure.