question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

axisgrid fails with matplotlib v2

See original GitHub issue

Trying to plot a joinplot, and axisgrid is failing with:

Traceback (most recent call last):
  File "jet_statistics.py", line 114, in <module>
    xlim=lims, ylim=lims)
  File "/home/dstansby/seaborn/seaborn/distributions.py", line 798, in jointplot
    xlim=xlim, ylim=ylim)
  File "/home/dstansby/seaborn/seaborn/axisgrid.py", line 1643, in __init__
    plt.setp(ax_marg_x.yaxis.get_minorticklines(), visible=False)
  File "/home/dstansby/miniconda3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 359, in setp
    return _setp(*args, **kwargs)
  File "/home/dstansby/miniconda3/lib/python3.5/site-packages/matplotlib/artist.py", line 1430, in setp
    insp = ArtistInspector(objs[0])
IndexError: list index out of range

I think this is because ax_marg_x.yaxis.get_minorticklines() is a list of zero length, which in matplotlib 2 causes plt.setp to throw an IndexError.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
drammockcommented, Mar 9, 2017

confirmed that this works after updating matplotlib. thanks @mwaskom.

0reactions
laurensvdwielcommented, Mar 20, 2017

The proposed fix in this issue also worked for me for matplotlib v1.4.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

matplotlib.axes.Axes.grid — Matplotlib 3.6.2 documentation
Configure the grid lines. Parameters: visiblebool or None, optional. Whether to show the grid lines. If any kwargs are supplied, it is assumed ......
Read more >
matplotlib.pyplot.errorbar — Matplotlib 3.6.2 documentation
An alias to the keyword argument markeredgewidth (a.k.a. mew). This setting is a more sensible name for the property that controls the thickness...
Read more >
matplotlib.axis.Axis.grid — Matplotlib 3.6.2 documentation
Configure the grid lines. Parameters: visiblebool or None. Whether to show the grid lines. If any kwargs are supplied, it is assumed you...
Read more >
API Changes for 3.5.0 — Matplotlib 3.6.2 documentation
The first parameter of Axes.grid and Axis.grid has been renamed to visible# ... Calling Figure.add_axes with no arguments will raise an error.
Read more >
Matplotlib 3.6.2 documentation
In [1]: %matplotlib In [2]: import matplotlib.pyplot as plt ... raise an ImportError if the backend cannot be set up (either because it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found