I'm quite new to python, but am attempting to add basic plotting
functionality to a tk-based GUI application that is run primarily on a
Mac. My initial attempts at simply calling "plot" or "errorbar" from
within the application resulted in erratic behavior on Python
installed through macports on my machine with OSX 10.5 (the plot
appears, but the window is unresponsive), or no plot whatsoever (on a
friend's Mac with OSX 10.6 and Python, Numpy, and Matplotlib installed
through their "official" .dmg packages). All versions are current
(Python 2.6.2, Matplotlib 0.99.1.1).
When looking at the matplotlib website, I attempted to run the
...but these fail on my machine (OSX 10.5):
udp009069uds:fret_analysis jshine$ python embedding_in_tk.py
Traceback (most recent call last):
File "embedding_in_tk.py", line 6, in <module>
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,
line 8, in <module>
import tkagg # Paint image to Tk photo blitter extension
line 1, in <module>
ImportError: No module named _tkagg
For those familiar with macports, I did install it with the "tkinter"
dp009069uds:fret_analysis jshine$ port info py26-matplotlib
py26-matplotlib @0.99.1.1 (python, graphics, math)
Variants: cairo, darwin_8, ghostscript, gtk2, latex, qt4,
Description: Matplotlib is a pure python plotting library
with the goal of making publication quality plots using a syntax
familiar to matlab
users. The library uses numpy for handling large
data sets and supports a variety of output backends. This port
provides variants for
the different GUIs (gtk2, tkinter, wxpython).
Library Dependencies: python26, freetype, libpng, py26-dateutil,
py26-tz, py26-numpy, py26-configobj, py26-pyobjc2, py26-pyobjc2-cocoa
Maintainers: ram@...1611..., openmaintainer@...1611...
...so at this point, I'm pretty much stuck -- my own application
doesn't work, and I don't have a working example to follow. I'd
greatly appreciate any pointers!
Jonathan Tomshine, PhD
University of California, San Francisco
600 16th St.
San Francisco, CA 94158-2140