Seaborn: AttributeError: 'FigureCanvasMac' object has no attribute 'get_renderer'

Created on 28 Feb 2018  路  1Comment  路  Source: mwaskom/seaborn

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'

Most helpful comment

How did you fix this?

>All comments

How did you fix this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

songololo picture songololo  路  4Comments

JanHomann picture JanHomann  路  3Comments

wenhaosun picture wenhaosun  路  3Comments

chanshing picture chanshing  路  3Comments

tritemio picture tritemio  路  3Comments