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
matplolib empty figure on OS X when using conda-forge's tk #36
So it seems that the problem is not at all dependent on mpl version,
and not really dependent on installation method, either. Instead, it might
depend on the exact tk build:
My original "py37" environment (yielding a plot) had tk 8.6.9-ha92aebf_0
from conda-forge. Now I updated that to match the fresh environment
("mpl2") version, 8.6.9-h2573ce8_1002, and I get the white screen.
Switching back to the earlier tk build, I get the plot again.
When I downgrade tk in "mpl2" to 8.5.19, it downgrades a bunch of
other things including python to 3.6; but the test yields a window,
and the buttons work!
@ocefpaf it looks like there might be something very fiddly with tk
versions and builds for OSX in conda-forge.
I am not using conda but pip and virtualenv. I am also facing the same problem as the matplotlib fails to render the plots and python crashes. System details: macOS 10.14.5, Python 3.6, Virtualenv pip
I don't know if this helps, but I found that running my code with python3 explicitly allows the plotting to work correctly. With python only, the plotting windows are blank.
$ which python
/Users/me/anaconda3/envs/pmp/bin/python
$ which python3
/Users/me/anaconda3/envs/pmp/bin/python3
Both python and python3:
Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 14:38:56)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Sorry, I need to make a correction to the above. My plotting works if I use MacOSX backend, but not the default TkAgg backend.
Using: matplotlib.use('MacOSX')
or setting this in the ~/.matplotlib/matplotlibrc file fixes the plots for me.
I came across this thread searching for why gitk stopped working for me, and I'm convinced now that it is for the same reason as this problem with matplotlib. Specifically, I'm using "gitk" that comes installed with the git mac os x binary (version 2.2.0). When it invokes wish, it uses the version installed with my anaconda3 environment (Tk version 8.6.9) since it is ahead of it in my $PATH, and I get nothing but a blank window. After deactivating my anaconda environment, gitk uses /usr/bin/wish, which uses Tk/Tcl version 8.5 (presumably the Apple versions), and the window opens correctly.
Before Mojave, this was never an issue, as I recall.
While this may be something we should investigate, you should also file a bug with git about gitk if you wouldn't mind?
The bug would be along the lines that software that knows where its other bits live should not use PATH to locate or launch those other bits. It should instead use relative paths from known-to-exist filepaths.
Sorry, I need to make a correction to the above. My plotting works if I use MacOSX backend, but not the default TkAgg backend.
Using: matplotlib.use('MacOSX')
or setting this in the ~/.matplotlib/matplotlibrc file fixes the plots for me.
Thanks for the reply..But this doesn't work on mine. Same problem
Activity
efiring commentedon Jun 26, 2019
Possibly related: #30.
guyer commentedon Jul 5, 2019
As far as I can tell, the problem was introduced with build 1001 of 8.6.9:
renders as expected, but
produces a blank window.
Same thing with Matplotlib 3.1.1.
tk 8.6.8 and tk 8.6.9 build 0 and build 1000 are fine.
tk 8.6.9 build 1001 and build 1002 are not.
macOS 10.14.5 (18F132)
efiring commentedon Jul 5, 2019
Reminder: there are actually two problems related to tk versions. matplotlib/matplotlib#12074 (comment)
smithsp commentedon Jul 13, 2019
I have reports of this on Mac for another tk application.
vishalmhjn commentedon Jul 13, 2019
I am not using conda but pip and virtualenv. I am also facing the same problem as the matplotlib fails to render the plots and python crashes. System details: macOS 10.14.5, Python 3.6, Virtualenv pip
Miakatt commentedon Jul 19, 2019
I don't know if this helps, but I found that running my code with python3 explicitly allows the plotting to work correctly. With python only, the plotting windows are blank.
Both python and python3:
Matplotlib version 2.2.3
tk version 8.6.9
vishalmhjn commentedon Jul 19, 2019
@Miakatt What is your macOS version?
Miakatt commentedon Jul 19, 2019
@vishalmhjn It's Mojave. I'm not at the computer right now to supply the full version number I'm afraid. I can update on Monday.
Miakatt commentedon Jul 26, 2019
Sorry, I need to make a correction to the above. My plotting works if I use MacOSX backend, but not the default TkAgg backend.
Using:
matplotlib.use('MacOSX')or setting this in the ~/.matplotlib/matplotlibrc file fixes the plots for me.
Meteodan commentedon Aug 15, 2019
I came across this thread searching for why gitk stopped working for me, and I'm convinced now that it is for the same reason as this problem with matplotlib. Specifically, I'm using "gitk" that comes installed with the git mac os x binary (version 2.2.0). When it invokes wish, it uses the version installed with my anaconda3 environment (Tk version 8.6.9) since it is ahead of it in my $PATH, and I get nothing but a blank window. After deactivating my anaconda environment, gitk uses /usr/bin/wish, which uses Tk/Tcl version 8.5 (presumably the Apple versions), and the window opens correctly.
Before Mojave, this was never an issue, as I recall.
mingwandroid commentedon Aug 15, 2019
Thanks @Meteodan.
While this may be something we should investigate, you should also file a bug with git about gitk if you wouldn't mind?
The bug would be along the lines that software that knows where its other bits live should not use PATH to locate or launch those other bits. It should instead use relative paths from known-to-exist filepaths.
Meteodan commentedon Aug 15, 2019
@mingwandroid
Yes, of course, I will do so. Thank you for your reply.
vishalmhjn commentedon Aug 26, 2019
Thanks for the reply..But this doesn't work on mine. Same problem
ocefpaf commentedon Jan 2, 2023
Looks like this issue is fixed in the latest version. Let's close this and open a new one if we see it again.