Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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; 'tia,': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; '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; '64-bit,': 0.16; 'invoking': 0.16; 'luck,': 0.16; 'numpy': 0.16; 'received:mac.com': 0.16; 'resize': 0.16; 'skip:" 100': 0.16; 'wrote:': 0.17; 'received:10.0.1': 0.17; "shouldn't": 0.17; 'import': 0.21; 'delta': 0.22; 'doc': 0.22; 'finally,': 0.22; 'runs': 0.22; 'example': 0.23; "haven't": 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'script': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'looks': 0.26; '(most': 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; '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; 'received:10.0': 0.33; 'problem': 0.33; 'anyone': 0.33; 'eric': 0.35; 'received:17': 0.35; 'doing': 0.35; 'pm,': 0.35; 'but': 0.36; 'url:org': 0.36; 'apple': 0.36; 'be.': 0.36; 'subject:with': 0.36; 'charset:us-ascii': 0.36; 'beyond': 0.37; 'does': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'received:10': 0.38; 'page': 0.38; 'build': 0.39; 'url:mail': 0.40; 'think': 0.40; 'your': 0.60; 'latest': 0.61; 'here:': 0.62; 'skip:n 10': 0.63; 'to:addr:yahoo.com': 0.80; 'happening?': 0.84; 'url:master': 0.84; 'python.org,': 0.93 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.260,0.0.0000 definitions=2012-08-04_03:2012-08-03, 2012-08-04, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1208040108 Subject: Re: trouble with pyplot in os x From: "William R. Wing (Bill Wing)" In-reply-to: <3a2464ec-8fbc-4c45-8509-6861031f9204@googlegroups.com> Date: Sat, 04 Aug 2012 09:11:44 -0400 References: <3a2464ec-8fbc-4c45-8509-6861031f9204@googlegroups.com> To: Eric X-Mailer: Apple Mail (2.1485) Cc: python-list@python.org, "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: , Newsgroups: comp.lang.python Message-ID: Lines: 70 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1344089518 news.xs4all.nl 6863 [2001:888:2000:d::a6]:47136 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26487 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