-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Tutorial pyplot_scales.py crashes when used with plt.tight_layout() #6789
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
Comments
Here's a more minimalist example that throws the same error as above: import matplotlib.pyplot as plt
fig, axs = plt.subplots(2, 2)
axs[1, 1].set_yscale('logit')
plt.tight_layout()
plt.show() |
Todo (see #7880):
|
I've hit this bug, too. A slightly different minimal example, that doesn't depend on
Rendering with QT5Agg causes a similar error as in the original report:
I tried all the backends on my machine, with the same result (but perhaps slightly different error messages). The script works fine if Setting the y position to
is And I'm over my head at this point. |
... and calling
It also works with dstansby's
|
Seems to be fixed on |
Trying to replace
plt.subplots_adjust
withplt.tight_layout
in the pyplot tutorialpyplot_scales.py
(see #6779), seems to results in errors.Based on
pyplot_scales.py
:When I run this example with
plt.tight_layout
instead ofplt.subplots_adjust
(or simply no subplot layout adjusting at all), I get these outputs (mpl 2.0.0b3.post1799+ga4fdd60):which results in

(NB: it's a screenshot because
savefig
complained about the “ValueError: cannot convert float NaN to integer” stuff)which produces an empty figure.
See above.
note where it used to work:
The behavior seems to be the same with mpl 1.5.1 and (at least) both TkAgg and Qt4Agg backends.
The text was updated successfully, but these errors were encountered: