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

figure.autolayout rc param interferes with FacetGrid legend position #2496

Closed
sorenwacker opened this issue Mar 5, 2021 · 15 comments · Fixed by #2571
Closed

figure.autolayout rc param interferes with FacetGrid legend position #2496

sorenwacker opened this issue Mar 5, 2021 · 15 comments · Fixed by #2571

Comments

@sorenwacker
Copy link

I am pretty happy about that new feature legend_out. However, I cannot reproduce the figures shown in the documentation.
Am I doing something wrong or is this feature available only in the development branch?

When I use this code from the documentation:

import seaborn as sns
sns.set_theme(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise)

The legend shows up inside the graph. And passing legend_out=False or True looks identical.

import seaborn as sns
sns.set_theme(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise, facet_kws={'legend_out': True})

And this creates a legend on the lefthandside with a box around:

import seaborn as sns
sns.set_theme(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise, legend_out=False)

Did I forget something? Is there any other dependency like the matplotlib backend for example?

@sorenwacker
Copy link
Author

matplotlib version is 3.3.4

@mwaskom
Copy link
Owner

mwaskom commented Mar 5, 2021

Is there any other dependency like the matplotlib backend for example?

What matplotlib backend are you using? And more generally, how are you making your plots? (In a notebook? In a terminal? In a script and saving? etc.)

Putting the legend outside the axes does require seaborn to be able to live draw the figure so that it can calculate the new size that it will need to be with the external legend, which some backends might not support.

@sorenwacker
Copy link
Author

sorenwacker commented Mar 5, 2021

I tried generating the plots in JupyterLab.

matplotlib.get_backend()
> 'module://ipykernel.pylab.backend_inline'

And in an web-application (Plotly/Dash) that currently uses 'Agg' to generate figures.

This the current environment:

`name: py3
channels:

  • defaults
    dependencies:
  • _libgcc_mutex=0.1
  • _openmp_mutex=4.5
  • argon2-cffi=20.1.0
  • async_generator=1.10
  • attrs=20.3.0
  • backcall=0.2.0
  • blas=1.0
  • bleach=3.3.0
  • bokeh=2.2.3
  • brotlipy=0.7.0
  • ca-certificates=2021.1.19
  • certifi=2020.12.5
  • cffi=1.14.4
  • chardet=4.0.0
  • click=7.1.2
  • cloudpickle=1.6.0
  • cryptography=3.3.1
  • cytoolz=0.11.0
  • dask=2021.1.1
  • dask-core=2021.1.1
  • dbus=1.13.18
  • decorator=4.4.2
  • defusedxml=0.6.0
  • distributed=2021.1.1
  • entrypoints=0.3
  • expat=2.2.10
  • fontconfig=2.13.1
  • freetype=2.10.4
  • fsspec=0.8.3
  • glib=2.66.1
  • gst-plugins-base=1.14.0
  • gstreamer=1.14.0
  • heapdict=1.0.1
  • icu=58.2
  • idna=2.10
  • importlib-metadata=2.0.0
  • importlib_metadata=2.0.0
  • ipykernel=5.3.4
  • ipython=7.20.0
  • ipython_genutils=0.2.0
  • ipywidgets=7.6.3
  • jedi=0.17.2
  • jinja2=2.11.3
  • joblib=1.0.0
  • jpeg=9b
  • json5=0.9.5
  • jsonschema=3.2.0
  • jupyter=1.0.0
  • jupyter_client=6.1.7
  • jupyter_console=6.2.0
  • jupyter_core=4.7.1
  • jupyterlab=2.2.6
  • jupyterlab_pygments=0.1.2
  • jupyterlab_server=1.2.0
  • jupyterlab_widgets=1.0.0
  • lcms2=2.11
  • ld_impl_linux-64=2.35.1
  • libedit=3.1.20191231
  • libffi=3.3
  • libgcc-ng=9.3.0
  • libgfortran-ng=7.3.0
  • libgomp=9.3.0
  • libopenblas=0.3.10
  • libpng=1.6.37
  • libsodium=1.0.18
  • libstdcxx-ng=9.3.0
  • libtiff=4.1.0
  • libuuid=1.0.3
  • libxcb=1.14
  • libxml2=2.9.10
  • locket=0.2.1
  • lz4-c=1.9.3
  • markupsafe=1.1.1
  • mistune=0.8.4
  • msgpack-python=1.0.2
  • nbclient=0.5.1
  • nbconvert=6.0.7
  • nbformat=5.1.2
  • ncurses=6.2
  • nest-asyncio=1.4.3
  • networkx=2.5
  • nodejs=10.13.0
  • notebook=6.2.0
  • numpy-base=1.19.2
  • olefile=0.46
  • openssl=1.1.1j
  • packaging=20.9
  • pandoc=2.11
  • pandocfilters=1.4.3
  • parso=0.7.0
  • partd=1.1.0
  • pcre=8.44
  • pexpect=4.8.0
  • pickleshare=0.7.5
  • pillow=8.1.0
  • pip=20.3.3
  • plotly=4.14.3
  • prometheus_client=0.9.0
  • prompt-toolkit=3.0.8
  • prompt_toolkit=3.0.8
  • psutil=5.8.0
  • ptyprocess=0.7.0
  • pycparser=2.20
  • pygments=2.7.4
  • pyopenssl=20.0.1
  • pyparsing=2.4.7
  • pyqt=5.9.2
  • pyrsistent=0.17.3
  • pysocks=1.7.1
  • python=3.9.1
  • python-dateutil=2.8.1
  • pytz=2021.1
  • pyyaml=5.4.1
  • pyzmq=20.0.0
  • qt=5.9.7
  • qtconsole=5.0.2
  • qtpy=1.9.0
  • readline=8.1
  • requests=2.25.1
  • retrying=1.3.3
  • scikit-learn=0.23.2
  • scipy=1.6.0
  • send2trash=1.5.0
  • setuptools=52.0.0
  • sip=4.19.13
  • six=1.15.0
  • sortedcontainers=2.3.0
  • sqlite=3.33.0
  • tblib=1.7.0
  • terminado=0.9.2
  • testpath=0.4.4
  • threadpoolctl=2.1.0
  • tk=8.6.10
  • toolz=0.11.1
  • tornado=6.1
  • traitlets=5.0.5
  • typing_extensions=3.7.4.3
  • tzdata=2020f
  • urllib3=1.26.3
  • wcwidth=0.2.5
  • webencodings=0.5.1
  • wheel=0.36.2
  • widgetsnbextension=3.5.1
  • xz=5.2.5
  • yaml=0.2.5
  • zeromq=4.3.3
  • zict=2.0.0
  • zipp=3.4.0
  • zlib=1.2.11
  • zstd=1.4.5
  • pip:
    • cycler==0.10.0
    • et-xmlfile==1.0.1
    • jdcal==1.4.1
    • kiwisolver==1.3.1
    • matplotlib==3.3.4
    • numexpr==2.7.2
    • numpy==1.20.1
    • obonet==0.2.6
    • openpyxl==3.0.6
    • pandas==1.2.1
    • pyarrow==3.0.0
    • seaborn==0.11.1
    • tables==3.6.1
    • tqdm==4.56.0
    • xlrd==2.0.1`

@mwaskom
Copy link
Owner

mwaskom commented Mar 5, 2021

And to clarify, you're having the issue in the notebook as well as in dash? That's really surprising.

I cannot replicate:

image

But would like to understand further.

What happens if you do this?

import matplotlib.pyplot as plt
f, ax = plt.subplots()
print(f.stale)
f.canvas.draw()
print(f.stale)

@mwaskom
Copy link
Owner

mwaskom commented Mar 6, 2021

BTW the environment you're using has a lot in it ... while I don't have any specific hypotheses about other libraries causing problem, it might be a good idea to create a new environment with a minimal install of seaborn and its dependencies to see if you reproduce the issue there.

@sorenwacker
Copy link
Author

sorenwacker commented Mar 9, 2021

Hm, I created a new environment and installed the python kernel to my JupyterLab (3.0.9) with:

conda install -n seaborn seaborn=0.11.1 matplotlib=3.3.4 ipykernel ipython
ipython kernel install --name 'Seaborn' --user

name: seaborn
channels:
  - defaults
dependencies:
  - _libgcc_mutex=0.1
  - backcall=0.2.0
  - blas=1.0
  - ca-certificates=2021.1.19
  - certifi=2020.12.5
  - cycler=0.10.0
  - dbus=1.13.18
  - decorator=4.4.2
  - expat=2.2.10
  - fontconfig=2.13.1
  - freetype=2.10.4
  - glib=2.67.4
  - gst-plugins-base=1.14.0
  - gstreamer=1.14.0
  - icu=58.2
  - intel-openmp=2020.2
  - ipykernel=5.3.4
  - ipython=7.21.0
  - ipython_genutils=0.2.0
  - jedi=0.17.0
  - jpeg=9b
  - jupyter_client=6.1.7
  - jupyter_core=4.7.1
  - kiwisolver=1.3.1
  - lcms2=2.11
  - ld_impl_linux-64=2.33.1
  - libedit=3.1.20191231
  - libffi=3.3
  - libgcc-ng=9.1.0
  - libgfortran-ng=7.3.0
  - libpng=1.6.37
  - libsodium=1.0.18
  - libstdcxx-ng=9.1.0
  - libtiff=4.1.0
  - libuuid=1.0.3
  - libxcb=1.14
  - libxml2=2.9.10
  - lz4-c=1.9.3
  - matplotlib=3.3.4
  - matplotlib-base=3.3.4
  - mkl=2020.2
  - mkl-service=2.3.0
  - mkl_fft=1.3.0
  - mkl_random=1.1.1
  - ncurses=6.2
  - numpy=1.19.2
  - numpy-base=1.19.2
  - olefile=0.46
  - openssl=1.1.1j
  - pandas=1.2.3
  - parso=0.8.1
  - pcre=8.44
  - pexpect=4.8.0
  - pickleshare=0.7.5
  - pillow=8.1.2
  - pip=21.0.1
  - prompt-toolkit=3.0.8
  - ptyprocess=0.7.0
  - pygments=2.8.0
  - pyparsing=2.4.7
  - pyqt=5.9.2
  - python=3.8.8
  - python-dateutil=2.8.1
  - pytz=2021.1
  - pyzmq=20.0.0
  - qt=5.9.7
  - readline=8.1
  - scipy=1.6.1
  - seaborn=0.11.1
  - setuptools=52.0.0
  - sip=4.19.13
  - six=1.15.0
  - sqlite=3.33.0
  - tk=8.6.10
  - tornado=6.1
  - traitlets=5.0.5
  - wcwidth=0.2.5
  - wheel=0.36.2
  - xz=5.2.5
  - zeromq=4.3.3
  - zlib=1.2.11
  - zstd=1.4.5

I get the same result with the legend inside.

I looked for a matpotlib config file and deleted ~/config/matplotlib still the same result.

The other example that you provided plots an empty pair of axes. I would share a picture, but I am missing the upload function here.

@sorenwacker
Copy link
Author

image

@mwaskom
Copy link
Owner

mwaskom commented Mar 10, 2021

Hm, do you have any matplotlibrc files that might be getting picked up? What is the output of mpl.rcParams?

@sorenwacker
Copy link
Author

sorenwacker commented Mar 10, 2021

RcParams({'_internal.classic_mode': False,
'agg.path.chunksize': 0,
'animation.avconv_args': [],
'animation.avconv_path': 'avconv',
'animation.bitrate': -1,
'animation.codec': 'h264',
'animation.convert_args': [],
'animation.convert_path': 'convert',
'animation.embed_limit': 20.0,
'animation.ffmpeg_args': [],
'animation.ffmpeg_path': 'ffmpeg',
'animation.frame_format': 'png',
'animation.html': 'none',
'animation.html_args': [],
'animation.writer': 'ffmpeg',
'axes.autolimit_mode': 'data',
'axes.axisbelow': True,
'axes.edgecolor': '.15',
'axes.facecolor': 'white',
'axes.formatter.limits': [-5, 6],
'axes.formatter.min_exponent': 0,
'axes.formatter.offset_threshold': 4,
'axes.formatter.use_locale': False,
'axes.formatter.use_mathtext': False,
'axes.formatter.useoffset': True,
'axes.grid': False,
'axes.grid.axis': 'both',
'axes.grid.which': 'major',
'axes.labelcolor': '.15',
'axes.labelpad': 4.0,
'axes.labelsize': 12.0,
'axes.labelweight': 'normal',
'axes.linewidth': 1.25,
'axes.prop_cycle': cycler('color', [(0.2980392156862745, 0.4470588235294118, 0.6901960784313725), (0.8666666666666667, 0.5176470588235295, 0.3215686274509804), (0.3333333333333333, 0.6588235294117647, 0.40784313725490196), (0.7686274509803922, 0.3058823529411765, 0.3215686274509804), (0.5058823529411764, 0.4470588235294118, 0.7019607843137254), (0.5764705882352941, 0.47058823529411764, 0.3764705882352941), (0.8549019607843137, 0.5450980392156862, 0.7647058823529411), (0.5490196078431373, 0.5490196078431373, 0.5490196078431373), (0.8, 0.7254901960784313, 0.4549019607843137), (0.39215686274509803, 0.7098039215686275, 0.803921568627451)]),
'axes.spines.bottom': True,
'axes.spines.left': True,
'axes.spines.right': True,
'axes.spines.top': True,
'axes.titlecolor': 'auto',
'axes.titlelocation': 'center',
'axes.titlepad': 6.0,
'axes.titlesize': 12.0,
'axes.titleweight': 'normal',
'axes.titley': None,
'axes.unicode_minus': True,
'axes.xmargin': 0.05,
'axes.ymargin': 0.05,
'axes3d.grid': True,
'backend': 'module://ipykernel.pylab.backend_inline',
'backend_fallback': True,
'boxplot.bootstrap': None,
'boxplot.boxprops.color': 'black',
'boxplot.boxprops.linestyle': '-',
'boxplot.boxprops.linewidth': 0.75,
'boxplot.capprops.color': 'black',
'boxplot.capprops.linestyle': '-',
'boxplot.capprops.linewidth': 1.0,
'boxplot.flierprops.color': 'black',
'boxplot.flierprops.linestyle': 'none',
'boxplot.flierprops.linewidth': 0.5,
'boxplot.flierprops.marker': 'o',
'boxplot.flierprops.markeredgecolor': 'black',
'boxplot.flierprops.markeredgewidth': 0.5,
'boxplot.flierprops.markerfacecolor': 'none',
'boxplot.flierprops.markersize': 3.0,
'boxplot.meanline': False,
'boxplot.meanprops.color': 'C2',
'boxplot.meanprops.linestyle': '--',
'boxplot.meanprops.linewidth': 1.0,
'boxplot.meanprops.marker': '^',
'boxplot.meanprops.markeredgecolor': 'C2',
'boxplot.meanprops.markerfacecolor': 'C2',
'boxplot.meanprops.markersize': 6.0,
'boxplot.medianprops.color': 'black',
'boxplot.medianprops.linestyle': '-',
'boxplot.medianprops.linewidth': 0.75,
'boxplot.notch': False,
'boxplot.patchartist': False,
'boxplot.showbox': True,
'boxplot.showcaps': True,
'boxplot.showfliers': True,
'boxplot.showmeans': False,
'boxplot.vertical': True,
'boxplot.whiskerprops.color': 'black',
'boxplot.whiskerprops.linestyle': '--',
'boxplot.whiskerprops.linewidth': 0.5,
'boxplot.whiskers': 1.5,
'contour.corner_mask': True,
'contour.linewidth': None,
'contour.negative_linestyle': 'dashed',
'date.autoformatter.day': '%Y-%m-%d',
'date.autoformatter.hour': '%m-%d %H',
'date.autoformatter.microsecond': '%M:%S.%f',
'date.autoformatter.minute': '%d %H:%M',
'date.autoformatter.month': '%Y-%m',
'date.autoformatter.second': '%H:%M:%S',
'date.autoformatter.year': '%Y',
'date.epoch': '1970-01-01T00:00:00',
'docstring.hardcopy': False,
'errorbar.capsize': 0.0,
'figure.autolayout': True,
'figure.constrained_layout.h_pad': 0.04167,
'figure.constrained_layout.hspace': 0.02,
'figure.constrained_layout.use': False,
'figure.constrained_layout.w_pad': 0.04167,
'figure.constrained_layout.wspace': 0.02,
'figure.dpi': 72.0,
'figure.edgecolor': (1, 1, 1, 0),
'figure.facecolor': 'white',
'figure.figsize': [6.0, 4.0],
'figure.frameon': True,
'figure.max_open_warning': 20,
'figure.raise_window': True,
'figure.subplot.bottom': 0.125,
'figure.subplot.hspace': 0.2,
'figure.subplot.left': 0.125,
'figure.subplot.right': 0.9,
'figure.subplot.top': 0.88,
'figure.subplot.wspace': 0.2,
'figure.titlesize': 'large',
'figure.titleweight': 'normal',
'font.cursive': ['Apple Chancery',
'Textile',
'Zapf Chancery',
'Sand',
'Script MT',
'Felipa',
'cursive'],
'font.family': ['sans-serif'],
'font.fantasy': ['Comic Neue',
'Comic Sans MS',
'Chicago',
'Charcoal',
'ImpactWestern',
'Humor Sans',
'xkcd',
'fantasy'],
'font.monospace': ['DejaVu Sans Mono',
'Bitstream Vera Sans Mono',
'Computer Modern Typewriter',
'Andale Mono',
'Nimbus Mono L',
'Courier New',
'Courier',
'Fixed',
'Terminal',
'monospace'],
'font.sans-serif': ['Arial',
'DejaVu Sans',
'Liberation Sans',
'Bitstream Vera Sans',
'sans-serif'],
'font.serif': ['DejaVu Serif',
'Bitstream Vera Serif',
'Computer Modern Roman',
'New Century Schoolbook',
'Century Schoolbook L',
'Utopia',
'ITC Bookman',
'Bookman',
'Nimbus Roman No9 L',
'Times New Roman',
'Times',
'Palatino',
'Charter',
'serif'],
'font.size': 12.0,
'font.stretch': 'normal',
'font.style': 'normal',
'font.variant': 'normal',
'font.weight': 'normal',
'grid.alpha': 1.0,
'grid.color': '.8',
'grid.linestyle': '-',
'grid.linewidth': 1.0,
'hatch.color': 'black',
'hatch.linewidth': 1.0,
'hist.bins': 20,
'image.aspect': 'equal',
'image.cmap': 'rocket',
'image.composite_image': True,
'image.interpolation': 'antialiased',
'image.lut': 256,
'image.origin': 'upper',
'image.resample': True,
'interactive': True,
'keymap.all_axes': ['a'],
'keymap.back': ['left', 'c', 'backspace', 'MouseButton.BACK'],
'keymap.copy': ['ctrl+c', 'cmd+c'],
'keymap.forward': ['right', 'v', 'MouseButton.FORWARD'],
'keymap.fullscreen': ['f', 'ctrl+f'],
'keymap.grid': ['g'],
'keymap.grid_minor': ['G'],
'keymap.help': ['f1'],
'keymap.home': ['h', 'r', 'home'],
'keymap.pan': ['p'],
'keymap.quit': ['ctrl+w', 'cmd+w', 'q'],
'keymap.quit_all': [],
'keymap.save': ['s', 'ctrl+s'],
'keymap.xscale': ['k', 'L'],
'keymap.yscale': ['l'],
'keymap.zoom': ['o'],
'legend.borderaxespad': 0.5,
'legend.borderpad': 0.4,
'legend.columnspacing': 2.0,
'legend.edgecolor': '0.8',
'legend.facecolor': 'inherit',
'legend.fancybox': True,
'legend.fontsize': 11.0,
'legend.framealpha': 0.8,
'legend.frameon': True,
'legend.handleheight': 0.7,
'legend.handlelength': 2.0,
'legend.handletextpad': 0.8,
'legend.labelspacing': 0.5,
'legend.loc': 'best',
'legend.markerscale': 1.0,
'legend.numpoints': 1,
'legend.scatterpoints': 2,
'legend.shadow': False,
'legend.title_fontsize': 12.0,
'lines.antialiased': True,
'lines.color': 'C0',
'lines.dash_capstyle': 'butt',
'lines.dash_joinstyle': 'round',
'lines.dashdot_pattern': [6.4, 1.6, 1.0, 1.6],
'lines.dashed_pattern': [3.7, 1.6],
'lines.dotted_pattern': [1.0, 1.65],
'lines.linestyle': '-',
'lines.linewidth': 1.5,
'lines.marker': 'None',
'lines.markeredgecolor': 'auto',
'lines.markeredgewidth': 0.5,
'lines.markerfacecolor': 'none',
'lines.markersize': 6.0,
'lines.scale_dashes': True,
'lines.solid_capstyle': 'round',
'lines.solid_joinstyle': 'round',
'markers.fillstyle': 'full',
'mathtext.bf': 'sans:bold',
'mathtext.cal': 'cursive',
'mathtext.default': 'it',
'mathtext.fallback': 'cm',
'mathtext.fallback_to_cm': None,
'mathtext.fontset': 'dejavusans',
'mathtext.it': 'sans:italic',
'mathtext.rm': 'sans',
'mathtext.sf': 'sans',
'mathtext.tt': 'monospace',
'mpl_toolkits.legacy_colorbar': True,
'patch.antialiased': True,
'patch.edgecolor': 'w',
'patch.facecolor': (0.2980392156862745,
0.4470588235294118,
0.6901960784313725),
'patch.force_edgecolor': True,
'patch.linewidth': 1.0,
'path.effects': [],
'path.simplify': True,
'path.simplify_threshold': 0.111111111111,
'path.sketch': None,
'path.snap': True,
'pcolor.shading': 'flat',
'pdf.compression': 6,
'pdf.fonttype': 3,
'pdf.inheritcolor': False,
'pdf.use14corefonts': False,
'pgf.preamble': '',
'pgf.rcfonts': True,
'pgf.texsystem': 'xelatex',
'polaraxes.grid': True,
'ps.distiller.res': 6000,
'ps.fonttype': 3,
'ps.papersize': 'letter',
'ps.useafm': False,
'ps.usedistiller': None,
'savefig.bbox': None,
'savefig.directory': '~',
'savefig.dpi': 'figure',
'savefig.edgecolor': 'auto',
'savefig.facecolor': 'auto',
'savefig.format': 'png',
'savefig.jpeg_quality': 95,
'savefig.orientation': 'portrait',
'savefig.pad_inches': 0.1,
'savefig.transparent': False,
'scatter.edgecolors': 'face',
'scatter.marker': 's',
'svg.fonttype': 'path',
'svg.hashsalt': None,
'svg.image_inline': True,
'text.antialiased': True,
'text.color': '.15',
'text.hinting': 'force_autohint',
'text.hinting_factor': 8,
'text.kerning_factor': 0,
'text.latex.preamble': '',
'text.latex.preview': False,
'text.usetex': False,
'timezone': 'UTC',
'tk.window_focus': False,
'toolbar': 'toolbar2',
'webagg.address': '127.0.0.1',
'webagg.open_in_browser': True,
'webagg.port': 8988,
'webagg.port_retries': 50,
'xaxis.labellocation': 'center',
'xtick.alignment': 'center',
'xtick.bottom': True,
'xtick.color': '.15',
'xtick.direction': 'out',
'xtick.labelbottom': True,
'xtick.labelsize': 11.0,
'xtick.labeltop': False,
'xtick.major.bottom': True,
'xtick.major.pad': 3.5,
'xtick.major.size': 6.0,
'xtick.major.top': True,
'xtick.major.width': 1.25,
'xtick.minor.bottom': True,
'xtick.minor.pad': 3.4,
'xtick.minor.size': 4.0,
'xtick.minor.top': True,
'xtick.minor.visible': False,
'xtick.minor.width': 1.0,
'xtick.top': False,
'yaxis.labellocation': 'center',
'ytick.alignment': 'center_baseline',
'ytick.color': '.15',
'ytick.direction': 'out',
'ytick.labelleft': True,
'ytick.labelright': False,
'ytick.labelsize': 11.0,
'ytick.left': True,
'ytick.major.left': True,
'ytick.major.pad': 3.5,
'ytick.major.right': True,
'ytick.major.size': 6.0,
'ytick.major.width': 1.25,
'ytick.minor.left': True,
'ytick.minor.pad': 3.4,
'ytick.minor.right': True,
'ytick.minor.size': 4.0,
'ytick.minor.visible': False,
'ytick.minor.width': 1.0,
'ytick.right': False})

@sorenwacker
Copy link
Author

sorenwacker commented Mar 10, 2021

Not sure where else to look. I already deleted ~/.config/matplotlib.
Maybe the constrained_layout setting.

@sorenwacker
Copy link
Author

plt.rcParams['figure.autolayout'] = False

fixes it.

@mwaskom
Copy link
Owner

mwaskom commented Mar 10, 2021

Yes! Sorry I think I have encountered this once before. But that will do it.

@sorenwacker
Copy link
Author

Thanks for your time!

@mwaskom mwaskom reopened this Mar 10, 2021
@mwaskom
Copy link
Owner

mwaskom commented Mar 10, 2021

I actually think this can be handled in seaborn, using mpl.rc_context at the time of figure creation within FacetGrid (and PairGrid) to disable the figure.autolayout parameter.

@mwaskom mwaskom changed the title Cannot reproduce the plots in the documentation with 0.11.1 figure.autolayout rc param interferes with FacetGrid legend position Mar 10, 2021
mwaskom added a commit that referenced this issue May 5, 2021
* Disable autolayout rcparam when constructing Facet/PairGrid

Closes #2496

* Update release notes [skip ci]
mwaskom added a commit that referenced this issue Aug 6, 2021
* Disable autolayout rcparam when constructing Facet/PairGrid

Closes #2496

* Update release notes [skip ci]

(cherry picked from commit afe5635)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants