Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'exception': 0.03; 'binary': 0.05; 'error:': 0.05; '64-bit': 0.07; 'bash': 0.07; 'tkinter': 0.07; 'python': 0.09; '3.0,': 0.09; 'callback': 0.09; 'matplotlib': 0.09; 'skip:" 80': 0.09; 'tcl/tk': 0.09; 'tia,': 0.09; 'to:addr:comp.lang.python': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; '2.7': 0.13; 'aug': 0.13; "(it's": 0.16; '-i386': 0.16; '0.0,': 0.16; '0.025': 0.16; '1.5,': 0.16; '2.7.3': 0.16; '3.2)': 0.16; '64-bit,': 0.16; 'invoking': 0.16; 'luck,': 0.16; 'numpy': 0.16; 'resize': 0.16; 'skip:" 100': 0.16; 'wing': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; 'thanks,': 0.18; 'versions': 0.20; 'causing': 0.20; 'import': 0.21; 'delta': 0.22; 'doc': 0.22; 'finally,': 0.22; 'runs': 0.22; 'example': 0.23; "haven't": 0.23; 'installed': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'tried': 0.25; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'wondering': 0.26; '(most': 0.27; 'older': 0.27; 'cc:2**2': 0.27; "doesn't": 0.28; 'this?': 0.28; 'run': 0.28; 'post': 0.28; 'python"': 0.29; 'url:mailman': 0.29; "i'm": 0.29; 'stuff': 0.30; '(and': 0.32; 'url:python': 0.32; 'file': 0.32; 'not.': 0.32; 'sources': 0.32; 'running': 0.32; 'url:listinfo': 0.32; 'getting': 0.33; 'done,': 0.33; 'mixed': 0.33; 'traceback': 0.33; 'problem': 0.33; 'anyone': 0.33; 'received:google.com': 0.34; 'eric': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'apple': 0.36; 'be.': 0.36; "i'll": 0.36; 'subject:with': 0.36; 'too': 0.36; 'beyond': 0.37; 'does': 0.37; 'two': 0.37; 'why': 0.37; 'python.org': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'page': 0.38; 'build': 0.39; 'url:mail': 0.40; 'think': 0.40; 'your': 0.60; 'latest': 0.61; 'here:': 0.62; 'different': 0.63; 'skip:n 10': 0.63; 'august': 0.66; 'cc:addr:yahoo.com': 0.71; 'william': 0.78; 'happening?': 0.84; 'url:master': 0.84; 'try.': 0.91; 'python.org,': 0.93 Newsgroups: comp.lang.python Date: Sat, 4 Aug 2012 13:45:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.230.151.65; posting-account=5sjSAAkAAADWrvmYYN9Q5vfQ2WNdq-Wg References: <3a2464ec-8fbc-4c45-8509-6861031f9204@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 70.230.151.65 MIME-Version: 1.0 Subject: Re: trouble with pyplot in os x From: Eric To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org, Eric , "William R. Wing \(Bill Wing\)" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 151 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1344113157 news.xs4all.nl 6853 [2001:888:2000:d::a6]:36574 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26507 On Saturday, August 4, 2012 8:11:44 AM UTC-5, William R. Wing (Bill Wing) wrote: > On Aug 3, 2012, at 11:12 PM, Eric wrote: > > > > > I'm just starting to futz around with matplotlib and I tried to run this > > > example from the matplotlib doc page (it's the imshow() example): > > > > > > import numpy as np > > > import matplotlib.cm as cm > > > import matplotlib.mlab as mlab > > > import matplotlib.pyplot as plt > > > > > > delta = 0.025 > > > x = y = np.arange(-3.0, 3.0, delta) > > > X, Y = np.meshgrid(x, y) > > > Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) > > > Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1) > > > Z = Z2-Z1 # difference of Gaussians > > > > > > im = plt.imshow(Z, interpolation='bilinear', cmap=cm.gray, > > > origin='lower', extent=[-3,3,-3,3]) > > > > > > plt.show() > > > > > > > > > > OK > > > > > > > > I get the following error: > > > > > > Exception in Tkinter callback > > > Traceback (most recent call last): > > > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1410, in __call__ > > > return self.func(*args) > > > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 248, in resize > > > self.show() > > > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 252, in draw > > > tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) > > > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/tkagg.py", line 19, in blit > > > tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array)) > > > TclError > > > > > > > > > > This looks as though you are running the latest python from python.org, not the pre-installed python from Apple (that's good). > > > > > > > > I'm using Python 2.7.3 on OS X 10.6.8 and I'm invoking python by doing > > > "arch -i386 python" because matplotlib doesn't do 64-bit. Has anyone > > > else seen this? Does anyone know why this is happening? It looks > > > like a problem with tkinter but beyond that I haven't a clue. And, > > > finally, any ideas as to how to make it behave? > > > > > > > I DON'T know how tk is getting mixed into this, it shouldn't be. But I think I can tell you how to get matplotlib working... > > > > Matplotlib DOES do 64-bit, the problem is numpy, which as you download in binary form does not. But, if you copy the bash script here: > > > > https://raw.github.com/fonnesbeck/ScipySuperpack/master/install_superpack.sh > > > > it will download the sources and build a 64-bit numpy, which will then give you a default 64-bit full package of python, numpy, and matplotlib. > > > > That's what I've done, and my system runs the demo you listed in your post with no problems. > > > > > TIA, > > > eric > > > -- > > > http://mail.python.org/mailman/listinfo/python-list > > > > Good luck, > > -Bill Yes, I got the Python 2.7 (and 3.2) distributions from python.org and I also got Tcl/Tk per their directions. I still have all the old Apple installed stuff too plus some older Tcl/Tk. Doesn't matplotlib use Tk (Tkinter) to do its graphs and what-not? I also have at least two different versions of Tcl/Tk (8.5.7 and 8.5.12) and I'm wondering if that may not be causing problems. I'll give that bash script a try. Thanks, eric