Skip to content
New issue

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

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

Already on GitHub? # to your account

ArviZ uses constrained_layout=True even when disabling it in az.rcParams #1763

Closed
tomicapretto opened this issue Aug 23, 2021 · 1 comment · Fixed by #1764
Closed

ArviZ uses constrained_layout=True even when disabling it in az.rcParams #1763

tomicapretto opened this issue Aug 23, 2021 · 1 comment · Fixed by #1764

Comments

@tomicapretto
Copy link
Contributor

I'm using the "arviz-darkgrid" style and I'm getting a constrained layout even when I attempt to disable it via

az.rcParams["plot.matplotlib.constrained_layout"] = False

The code

import arviz as az
import matplotlib.pyplot as plt

az.style.use("arviz-darkgrid")
az.rcParams["plot.matplotlib.constrained_layout"] = False

fig, axes = plt.subplots(1, 2)

axes[0].scatter([1, 2], [1, 2])
axes[1].scatter([1, 2], [1, 2])
fig.subplots_adjust(bottom=0.2)

The result

image

The environment

%load_ext watermark
%watermark -n -u -v -iv -w
Last updated: Mon Aug 23 2021

Python implementation: CPython
Python version       : 3.8.5
IPython version      : 7.18.1

matplotlib: 3.4.3
arviz     : 0.11.2
json      : 2.0.9

Watermark: 2.1.0
@aloctavodia
Copy link
Contributor

We are setting constrained_layout twice, and that is causing this bug.

In the meantime you can disable it using plt.rcParams['figure.constrained_layout.use'] = False

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants