Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Cannot get window extent w/o renderer #545

Closed
enricorotundo opened this issue May 9, 2015 · 5 comments
Closed

RuntimeError: Cannot get window extent w/o renderer #545

enricorotundo opened this issue May 9, 2015 · 5 comments

Comments

@enricorotundo
Copy link

I'm trying to plot a seaborn clustermap (it doesn't work with the heatmap too) with the following, no NaNs admitted:

    import numpy as np
    import pandas as pd
    import seaborn as sns
    import matplotlib.pyplot as plt

    def plotClusterMap():
        a = pd.DataFrame(np.matrix('1 2; 3 4'))
        print a
        fig = plt.figure()
        sns.clustermap(a)
        plt.show()

a is well formed:

   0  1
0  1  2
1  3  4

Console output:

Traceback (most recent call last):
  File "main.py", line 78, in <module>
    main()
  File "main.py", line 72, in main
    heatmapPlotter.plotClusterMap()
  File "/Users/username/code.py", line 12, in plotClusterMap
    sns.clustermap(a)
  File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 895, in clustermap
    **kwargs)
  File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 813, in plot
    self.plot_matrix(colorbar_kws, mask, **kws)
  File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 803, in plot_matrix
    cbar_kws=colorbar_kws, mask=mask, **kws)
  File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 292, in heatmap
    plotter.plot(ax, cbar_ax, kwargs)
  File "/Library/Python/2.7/site-packages/seaborn/matrix.py", line 177, in plot
    if axis_ticklabels_overlap(xtl):
  File "/Library/Python/2.7/site-packages/seaborn/utils.py", line 374, in axis_ticklabels_overlap
    bboxes = [l.get_window_extent() for l in labels]
  File "/usr/local/lib/python2.7/site-packages/matplotlib/text.py", line 796, in get_window_extent
    raise RuntimeError('Cannot get window extent w/o renderer')
RuntimeError: Cannot get window extent w/o renderer
  • Mac OSX: 10.10.3
  • Seaborn: 0.5.1
  • Matplotlib: 1.3.1 (just downgraded from 1.4)
@enricorotundo
Copy link
Author

Python 3.4.2 and numpy 1.9.2 don't solve the error :(

@enricorotundo
Copy link
Author

Workaround here...

@mwaskom
Copy link
Owner

mwaskom commented May 9, 2015

Yeah as far as I understand this is a known issue in the matplotlib MacOSX backend.

@eyadsibai
Copy link

actually u could do matplotlib.use('agg')
This is a bug in matplotlib in Mac OS X

@mwaskom
Copy link
Owner

mwaskom commented Jun 28, 2015

Closed with #611

@mwaskom mwaskom closed this as completed Jun 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants