You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2.2.3 matplotlib.pyplot.plot() creates empty plot. savefig() works as expected. #12074
When using the latest stable version of matplotlib (v2.2.3), running plt.plot() only displays a blank figure, regardless of chosen backend. However, the .savefig() method correctly stores an image of the plot.
Switching to an older version (2.0.2) resolves the issue.
Reacted by Cameron Davidson-Pilon, Wenlin Tsai, Erik Werner, Sun Haoran, Daniel, Popiko, Alexander Cyon, Janosh Riebesell, lllmmmmmmmmm, Tobe Osakwe and 1 more
@jklymak Interesting. Just installed anaconda (I don't usually use it, so may not keep it) and created a new env and installed matplotlib, ran the code and voilà, the figure shows the data as expected.
Doesn't seem to be an issue with matplotlib at all after all. Any thoughts on what to try next? Think this is an issue with pip?
This may be an issue with tk. We changed details about how exactly the c-extension we need for tk is built / linked in 2.2 (to support pypy!).
What version of osx? This may also be an issue with the wheels and conflicts between the tk you have, the tk they were built with, and the version of OSX they were built with vs the version of OSX you have.
Reacted by Counting Clouds, zhouwu huang, LI XIANGWEI, Ryan A., Sun Haoran, Alexandre Attia, Moe Kayali, Woochan Hwang, Janosh Riebesell, torta24x and 4 more
@shamoons can you re-open a full issue, including versions, what you did to install, and what you have tried to fix the problem. As noted above, this is usually an installation problem with an old library lying around from a previous install somehow not being cleared out. Thanks...
This looks like it is issues with how tk is built and its interaction with OSX , closing as there is nothing we can do about it at the Matplotlib level.
I'm going to re-open until conda rebuilds so folks searching the issues and not at closed issues will see that this is an understood issue and an upstream problem....
Using tk 8.6.12 he1e0b03_0 conda-forge (the latest version) this seems to be working fine for me, so I'm going to close this. If this is still an issue for anyone please comment and I will re-open!
Activity
mmenschig commentedon Sep 9, 2018
Further testing shows that the bug does not reproduce using versions 2.1.2.
jklymak commentedon Sep 9, 2018
I cannot reproduce using master or v2.2.3. My guess would be pip didn't install something for you properly...
mmenschig commentedon Sep 9, 2018
@jklymak running macOS?
jklymak commentedon Sep 9, 2018
Yes, but I install via conda.
mmenschig commentedon Sep 9, 2018
@jklymak Interesting. Just installed anaconda (I don't usually use it, so may not keep it) and created a new env and installed matplotlib, ran the code and voilà, the figure shows the data as expected.
Doesn't seem to be an issue with matplotlib at all after all. Any thoughts on what to try next? Think this is an issue with pip?
phobson commentedon Sep 10, 2018
How fresh is your pip-based environment that produces this issue? Can you provide steps to recreate the environment?
tacaswell commentedon Sep 10, 2018
This may be an issue with tk. We changed details about how exactly the c-extension we need for tk is built / linked in 2.2 (to support pypy!).
What version of osx? This may also be an issue with the wheels and conflicts between the tk you have, the tk they were built with, and the version of OSX they were built with vs the version of OSX you have.
mmenschig commentedon Sep 10, 2018
The issue appears with macOS Mojave (10.14 Beta (18A384a))
Just tested this with macOS Sierra (10.12.6) and the figure is displayed correctly.
tacaswell commentedon Sep 10, 2018
If you have a beta OSX, can you direct this issue towards them?
jklymak commentedon Sep 10, 2018
Closing as I don't think this is us. I think either Tk needs to be updated or there is an issue w/ OSX
mmenschig commentedon Sep 17, 2018
Thank you @jklymak
I'll be revisiting this issue when the current beta version of macOS gets released and provide an update then.
shamoons commentedon Feb 12, 2019
Can we reopen? I'm having this issue with 10.14.3
jklymak commentedon Feb 12, 2019
@shamoons can you re-open a full issue, including versions, what you did to install, and what you have tried to fix the problem. As noted above, this is usually an installation problem with an old library lying around from a previous install somehow not being cleared out. Thanks...
DaoSYi commentedon Feb 14, 2019
I have the same problem.
35 remaining items
janosh commentedon Jun 26, 2019
This has been bugging me for quite a while now. From skimming this issue, it seems it's still unclear where this problem originates?
efiring commentedon Jun 26, 2019
Yes, it's unclear. It would be great to have someone with expertise in all 3 of Tk, OSX, and mpl to track down the problem and solve it.
ocefpaf commentedon Jun 26, 2019
Opened conda-forge/tk-feedstock#36 to track this.
tacaswell commentedon Aug 19, 2019
This looks like it is issues with how tk is built and its interaction with OSX , closing as there is nothing we can do about it at the Matplotlib level.
jklymak commentedon Aug 28, 2019
I'm going to re-open until conda rebuilds so folks searching the issues and not at closed issues will see that this is an understood issue and an upstream problem....
Update demo.py
vboikotriller commentedon Feb 9, 2021
I have the same issue on Linux Debian.
matplotlib==3.3.4
Pillow==8.1.0
python3-tk 3.9.1-2
"""
import matplotlib.pyplot as plt
import numpy as np
plt.title("Title")
plt.plot(np.linspace(-1, 1, 50), np.linspace(-2, 2, 50))
"""
If I take title out, it works. Why matplotlib can't display titles ?
jklymak commentedon Feb 9, 2021
If you have checked your install please open a new issue.
dstansby commentedon Jan 2, 2023
Using
tk 8.6.12 he1e0b03_0 conda-forge(the latest version) this seems to be working fine for me, so I'm going to close this. If this is still an issue for anyone please comment and I will re-open!