1

The following code gives errors I don't understand why :

    import numpy as np
    import matplotlib.pyplot as plt
    a = np.arange(10)
    plt.plot(a)
    [<matplotlib.lines.Line2D at 0x116be8890>]
    plt.show()

    2013-01-29 10:58:18.891 Python[27257:903] *** __NSAutoreleaseNoPool(): Object 0x105b27810 of class NSCFArray autoreleased with no pool in place - just leaking
    2013-01-29 10:58:18.893 Python[27257:903] *** __NSAutoreleaseNoPool(): Object 0x105b37f60 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking
    2013-01-29 10:58:18.895 Python[27257:903] *** __NSAutoreleaseNoPool(): Object 0x105bee900 of class NSObject autoreleased with no pool in place - just leaking

I have matplotlib 1.2.0, numpy 1.6.2, python 2.7.3 and ipython 0.13.1. The packages have been installed with macports. This is doing it on Mac OS 10.6.8, and I don't see it on 10.7.5.

Edit : this post shows the same error, although no solution has been clearly found

2
  • This link may help you out if you haven't seen it. Commented Jan 30, 2013 at 8:21
  • Thanks. I had seen it before and checked whether I had pyobjc installed or not. It turns out I have PyObjC 2.4 and PyObjC-cocoa 2.4 installed with macports too. Commented Jan 30, 2013 at 14:06

2 Answers 2

1

I haven't found a solution yet. My workaround has been to install another backend : qt4. This requires to do :

    sudo port install qt4-mac
    sudo port install py27-qt4

and then modify (or create if None) the file ~/.matplotlib/matplotlibrc by adding :

    backend : QT4Agg

Then the above text works without problem.

Sign up to request clarification or add additional context in comments.

Comments

0

I am also having this problem, my work around is to add:

plt.ion()

before the first plot command. This turns on the interactive plotting mode and it makes the errors go away.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.