Skip to content

matplotlib-2.2.0rc1 seems unhappy with a sharex+sharey display #1378

Closed

Description

@stonebig

Bug report (also in matplotlib/matplotlib#10585)

Bug summary

My historic Seaborn example doesn't seem to work anymore with Matplotlib-2.2.0rc1. how to survive this ?

# Seaborn
# for more examples, see http://stanford.edu/~mwaskom/software/seaborn/examples/index.html
import seaborn as sns
sns.set()
df = sns.load_dataset("iris")
sns.pairplot(df, hue="species", size=1.5)

Actual outcome

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-78e2f3db95aa> in <module>()
      4 sns.set()
      5 df = sns.load_dataset("iris")
----> 6 sns.pairplot(df, hue="species", size=1.5)

C:\WinPython\bd35\buildQt5\winpython-32bit-3.5.x.2\python-3.5.4\lib\site-packages\seaborn\axisgrid.py in pairplot(data, hue, hue_order, palette, vars, x_vars, y_vars, kind, diag_kind, markers, size, aspect, dropna, plot_kws, diag_kws, grid_kws)
   2058     if grid.square_grid:
   2059         if diag_kind == "hist":
-> 2060             grid.map_diag(plt.hist, **diag_kws)
   2061         elif diag_kind == "kde":
   2062             diag_kws["legend"] = False

C:\WinPython\bd35\buildQt5\winpython-32bit-3.5.x.2\python-3.5.4\lib\site-packages\seaborn\axisgrid.py in map_diag(self, func, **kwargs)
   1333                     diag_ax = ax._make_twin_axes(sharex=ax,
   1334                                                  sharey=diag_axes[0],
-> 1335                                                  frameon=False)
   1336                 else:
   1337                     diag_ax = ax._make_twin_axes(sharex=ax, frameon=False)

C:\WinPython\bd35\buildQt5\winpython-32bit-3.5.x.2\python-3.5.4\lib\site-packages\matplotlib\axes\_subplots.py in _make_twin_axes(self, *kl, **kwargs)
    174         from matplotlib.projections import process_projection_requirements
    175         if 'sharex' in kwargs and 'sharey' in kwargs:
--> 176             raise ValueError("Twinned Axes may share only one axis.")
    177         kl = (self.get_subplotspec(),) + kl
    178         projection_class, kwargs, key = process_projection_requirements(

ValueError: Twinned Axes may share only one axis.

Matplotlib version

  • Operating system: windows10
  • Matplotlib version: 2.2.0rc1 of feb 18th cgohlke
  • Matplotlib backend (print(matplotlib.get_backend())):module://ipykernel.pylab.backend_inline
  • Python version: 3.5.4
  • Jupyter version (if applicable): Jupyterlab-0.31.8
  • Other libraries:

Activity

  1. changed the title [-]matplotlib-2.2.0rc1 seems unhappy with a sharex+sharey displyay[/-] [+]matplotlib-2.2.0rc1 seems unhappy with a sharex+sharey display[/+] on Feb 24, 2018
  2. stonebig commented on Feb 24, 2018

    @stonebig
    ContributorAuthor

    problem comes from this change in matplotlib:
    matplotlib/matplotlib#10033

  3. stonebig commented on Feb 24, 2018

    @stonebig
    ContributorAuthor

    this shot-in-the-dark change seems to work now, not usre it's the right thing to do

    # don't ax me twice if matplotlib >=2.2.0rc1 
    ax._make_twin_axes(# sharex=ax,,
     sharey=diag_axes[0],
     frameon=False)
    
  4. mwaskom commented on Feb 24, 2018

    @mwaskom
    Owner

    There's probably not going to be a seaborn release any time soon so if it's possible for matplotlib not to break this, it would be idea.

  5. mwaskom commented on Feb 24, 2018

    @mwaskom
    Owner

    That said, big oops using a private ax method there...

  6. mwaskom commented on Mar 1, 2018

    @mwaskom
    Owner

    Closed with matplotlib/matplotlib#10622, thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions