import matplotlib.pyplot as plt import seaborn hoge # ndarray (H,W) fig = plt.figure() sbplt = fig.add_subplot() sbplt = seaborn.heatmap(hoge, vmin=0.0,vmax=1.0, annot=True, fmt='1.3f', ax=sbplt) sbplt.figure.savefig('hoge.pdf')