Bug summary
I'm trying to using heat map feature in my project, but when I installed sns and tried the heat map tutorial on website, it showed AttributeError: 'FigureCanvasMac' object has no attribute 'get_renderer'.
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Load the example flights dataset and conver to long-form
flights_long = sns.load_dataset("flights")
flights = flights_long.pivot("month", "year", "passengers")
# Draw a heatmap with the numeric values in each cell
f, ax = plt.subplots(figsize=(9, 6))
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax)
Actual outcome
Traceback (most recent call last):
File "/Users/lou/Desktop/Stock-ANA/src/StStatistics.py", line 251, in <module>
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax)
File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 528, in heatmap
plotter.plot(ax, cbar_ax, kwargs)
File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 315, in plot
ax.figure.draw(ax.figure.canvas.get_renderer())
AttributeError: 'FigureCanvasMac' object has no attribute 'get_renderer'
How did you fix this?
Most helpful comment
How did you fix this?