Plots show up completely white #2000

Closed
bmorris3 opened this Issue May 13, 2013 · 12 comments

Comments

Projects
None yet
4 participants

Lately when I try to show a plot, a white box shows up on my screen in the shape of the window that should be produced, but it doesn't have any UI elements -- no "X" button, no title-bar, nothing. Screenshot below:

screen shot 2013-05-13 at 4 49 52 pm
The plain white box in the center of the screen shows up when draw() is called, in the shape of the figure that matplotlib should produce, but never fills in with anything.

In an interactive Python session I can produce plots, but I get the following barfed back:

2013-05-13 16:52:00.253 Python[21360:a0f] *** __NSAutoreleaseNoPool(): Object 0x1083e1d50 of class NSCFArray autoreleased with no pool in place - just leaking
2013-05-13 16:52:00.255 Python[21360:a0f] *** __NSAutoreleaseNoPool(): Object 0x10838e060 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking
2013-05-13 16:52:00.262 Python[21360:a0f] *** __NSAutoreleaseNoPool(): Object 0x1083c41a0 of class NSObject autoreleased with no pool in place - just leaking

I have installed and tried all versions of Matplotlib available on the website, and I have had the same problem with every one. Since I'm running Mac OS X 10.6, it seems likely that it's an issue related to my OS but I can't remedy it with any of the recommended tips on stackoverflow. I'm aware of the setup precautions for OSX regarding libpng and freetype and I know that both are properly installed. To ensure that it wasn't an installation issue due to something silly like that, I tried installing Enthought and running their version of matplotlib, but I still have the same problem.

Owner

mdboom commented May 13, 2013

What backend do you have configured in your ~/.matplotlib/matplotlibrc file?

By default it seems to be GTKAgg. Changing it to MacOSX as suggested by some threads doesn't fix it.

Member

pelson commented May 14, 2013

Wow, this looks pretty broke! @efiring / @mdehoon / @dmcdougall - do any of you have 10.6 available?

@bmorris3 - because you get this with different backends (you can check which backend is actually being used with import matplotlib.pyplot as plt; plt.get_backend()) it would suggest that there is a problem with your Python installation. Are you able to run idle (the standard python editor)?

plt.get_backened() returns MacOSX.

Yes, I can run idle.

Member

pelson commented May 14, 2013

plt.get_backened() returns MacOSX.

Was GTKAgg a red-herring then? I'm trying to isolate where the problem could be, so if it is only on the MacOSX backend then we have a pretty good candidate where the problem lies, otherwise it's likely that the problem is with your Python setup...

GTKAgg was the default setting in ~/.matplotlib/matplotlibrc, and then since I had seen some suggestions that I'd be safer with the MacOSX backened, I switched it to MacOSX. I can switch it back if you think that's a good idea for debugging.

Owner

efiring commented May 14, 2013

@pelson, no, I don't have access to 10.6.

There is a lot of information missing here--e.g., what kind of Python (system, python.org, fink, darwinports, homebrew...); what is the difference between "when I try to show a plot" and "in an interactive Python session"? etc.

It sounds like the system was working normally, and then this problem started. Something in the system must have changed. Something that is assumed to be true, isn't true. If the behavior is the same with Enthought as before, then either the problem is deep in the system, or when you think you are running Enthought python, you aren't, or... who knows?

You're absolutely right, there are all kinds of possibilities that
something's funky deep in my system, and I don't intend to ask you to probe
some extremely specific problem that could simply be a result of me
installing the some obscurely inappropriate combination of packages. I was
hoping that this issue may have come up in the past and that there would be
a simple solution. I'll keep trying to fix it for myself for now unless I
can come up with more specific information about how and when it fails.

On Tue, May 14, 2013 at 2:06 PM, Eric Firing notifications@github.comwrote:

@pelson https://github.com/pelson, no, I don't have access to 10.6.

There is a lot of information missing here--e.g., what kind of Python
(system, python.org, fink, darwinports, homebrew...); what is the
difference between "when I try to show a plot" and "in an interactive
Python session"? etc.

It sounds like the system was working normally, and then this problem
started. Something in the system must have changed. Something that is
assumed to be true, isn't true. If the behavior is the same with Enthought
as before, then either the problem is deep in the system, or when you think
you are running Enthought python, you aren't, or... who knows?


Reply to this email directly or view it on GitHubhttps://github.com/matplotlib/matplotlib/issues/2000#issuecomment-17893986
.

Ok, I've completely deleted Python 2.7 from my machine and started fresh with new packages and I'm still getting the same error, so I'll go into some detail as per @efiring . I'm running Mac 10.6.8 with Xcode 3.2.6 (64 bit). Here's the list of packages relavent to matplotlib that I installed:

  • python2.7.3
  • matplotlib1.2.1 (installed from source, as recommended by README.osx)
  • numpy-1.7.1-py2.7-python.org-macosx10.6

And some others that I don't think should matter but I installed so that I could run my script:

  • wxPython2.9-osx-2.9.4.0-cocoa-py2.7
  • scipy-0.12.0-py2.7-python.org-macosx10.6
  • pyfits-3.1.2

I've checked that I'm not running Python from the Enthought distro which I did not remove:

% which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

Before installing mpl I installed freetype and libpng with this command and these warnings

% sudo port install libpng freetype
...
Warning: Error parsing file /opt/local/lib/apple-gcc40/lib/gcc/i686-apple-darwin10.8.0/4.0.1/kext/crt3.o: Premature end of data, possibly corrupt file
--->  Scanning binaries for linking errors: 14.5%
Warning: Error parsing file /opt/local/lib/apple-gcc40/lib/gcc/i686-apple-darwin10.8.0/4.0.1/static/crt3.o: Premature end of data, possibly corrupt file
...

which are expected according to this thread.

Then I installed mpl from source with python setup.py install, and I noticed this warning:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

and this one

i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because linking not done

I wanted to check on @pelson 's comments on the backend what my backend is in my ~/.matplotlib/matplotlibrc file, but there is none. In my ~/.matplotlib/ directory I only find:

fontList.cache    tex.cache

If I check using @pelson 's method (plt.get_backend()), I get MacOSX.

I've tried using plt.savefig(<filename>) to save the plots as they are produced so that I can try to take a look at them from a non-interactive perspective, but they don't ever save -- the files never show up.

The code that I'm running that makes the white plot is quite complicated, but it amounts to a call of this script (link to my GitHub repo copy). I've tried running simpler scripts to test whether or not the problem is specific to my script; here's a simple interactive plot I made that successfully produces a plot, but returns some leaking warnings that I've never seen before

% python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib import pyplot as plt
>>> plt.plot([1,2,3,4])
[<matplotlib.lines.Line2D object at 0x1022c5c10>]
>>> plt.show()
2013-05-14 22:17:00.236 Python[9138:607] *** __NSAutoreleaseNoPool(): Object 0x115701380 of class NSCFArray autoreleased with no pool in place - just leaking
2013-05-14 22:17:00.238 Python[9138:607] *** __NSAutoreleaseNoPool(): Object 0x115703110 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking
2013-05-14 22:17:00.240 Python[9138:607] *** __NSAutoreleaseNoPool(): Object 0x102399360 of class NSObject autoreleased with no pool in place - just leaking

Does any of that bring any insight?

Owner

efiring commented May 15, 2013

I think this would be easier to follow and more likely to be productive on the users' mailing list. Many more people would see it, and it would be possible to respond to particular messages instead of ending up with this single linear thread. It is also more appropriate because this does not appear to be a bug in mpl. When you move your question to the mailing list, you can also provide more information--a more thorough description of how you generate the problem (e.g., running interactively from the plain python prompt? From ipython --pylab? From a script?), and of what might have changed on your system at the time of transition from working to non-working.

I'm going to close this issue, but you can still refer to it in your post to the matplotlib-users list.

@efiring efiring closed this May 15, 2013

OK, how do I post to matplotlib-users?

Owner

efiring commented May 15, 2013

http://matplotlib.org/faq/troubleshooting_faq.html

Go to https://lists.sourceforge.net/lists/listinfo/matplotlib-users to subscribe. Do not select the "batched in a daily digest" option, because it makes it difficult to respond properly to individual messages, and at least while you are trying to get a problem solved, you will want to do so. Once subscribed, you simply write to matplotlib-users@lists.sourceforge.net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment