0

I've been using matplotlib for a few weeks and generating some plots for my machine learning data. I'd like to generate some nice heatmaps using seaborn, but can't for the life of me figure out how to actually get the plot to display.

Working through the tutorials and examples on the seaborn website, they provide the following for a hexbin plot:

import numpy as np
from scipy.stats import kendalltau
import seaborn as sns
sns.set(style="ticks")

rs = np.random.RandomState(11)
x = rs.gamma(2, size=1000)
y = -.5 * x + rs.normal(size=1000)

sns.jointplot(x, y, kind="hex", stat_func=kendalltau, color="#4CB391")

If I run this script, it doesn't generate any plot. I'm kind of a noob with python, so if you could let me know what I'm missing here, I'd appreciate it.

Vranvs
  • 1,301
  • 4
  • 16
  • 33
  • Add `plt.show()` at the end? – DavidG Jan 31 '18 at 15:51
  • Hi, I'm an idiot. I tried the plt.show() the other day and it threw a 'not defined error'. Adding 'import matplotlib.pyplot as plt' and then using plt.show() fixed it. So sorry. Thanks! – Vranvs Jan 31 '18 at 16:23

0 Answers0