
Hi gang, For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image. thanks, Randy

FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data... On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas). But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget). It also might or might not be easier for you to provide BLT for NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody? --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

Sorry for the quick response, I can flesh it out in some more detail if anyone is interested... We have used BLT2 to display 2D graphs from inside Chimera. The input are typically energies or other emissions as a function of simulation time from our simulation software (ilmm) that interfaces with Chimera. I never found a way to update the graph in real time (even though we can pump the data in over a socket from the simulation code). Instead the Pmw.Blt.Graph object has to be reloaded. There must be a way around this. The graphs are ugly and not in any way acceptable for publication. The experience of getting everything to build against the correct headers and python libraries was frustrating. The distribution to machines in our lab is kludgy at best. I've never gotten it working under Windows or Mac. In case there is any doubt from my tone, we really don't like the BLT solution. Some of my notes on getting it to work with an older version of Chimera: BLT info: Configure command for BLT to w/ with Daggett Lab chimera installation: ./configure --prefix=/net/programs/chimera/lib --with-tkincls=/net/programs/chimera/include --with-tclincls=/net/programs/chimera/include --with-blt=/net/programs/chimera/lib --with-tcllibs=/net/programs/chimera/lib --with-tklibs=/net/programs/chimera/lib make install for BLT is broken, and must be finished by hand; run make install, copy the libraries (.so) from /var/tmp/chimeraBuild/build/foreign/tcl8.4.2.16/lib to /net/programs/chimera/lib, then move the /net/programs/chimera/lib/blt2.4 directory into /net/programs/chimera/lib/tcl8.4 it seems that the stuff in /var/tmp/chimeraBuild/build/foriegn... has to be there for this to work -- David A. C. Beck, Ph.D. dacb@u.washington.edu Valerie Daggett Laboratory University of Washington, Seattle On Mon, 3 Nov 2008, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas). But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget). It also might or might not be easier for you to provide BLT for NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

Hey, negative experiences are valuable to know about too! The more info we have for making a decision, the better. We do have practice with making recalcitrant builds bend to our will though. :-) --Eric On Nov 3, 2008, at 3:09 PM, David A. C. Beck wrote:
Sorry for the quick response, I can flesh it out in some more detail if anyone is interested...
We have used BLT2 to display 2D graphs from inside Chimera. The input are typically energies or other emissions as a function of simulation time from our simulation software (ilmm) that interfaces with Chimera. I never found a way to update the graph in real time (even though we can pump the data in over a socket from the simulation code). Instead the Pmw.Blt.Graph object has to be reloaded. There must be a way around this. The graphs are ugly and not in any way acceptable for publication.
The experience of getting everything to build against the correct headers and python libraries was frustrating. The distribution to machines in our lab is kludgy at best. I've never gotten it working under Windows or Mac. In case there is any doubt from my tone, we really don't like the BLT solution.
Some of my notes on getting it to work with an older version of Chimera:
BLT info:
Configure command for BLT to w/ with Daggett Lab chimera installation: ./configure --prefix=/net/programs/chimera/lib --with-tkincls=/net/ programs/chimera/include --with-tclincls=/net/programs/chimera/ include --with-blt=/net/programs/chimera/lib --with-tcllibs=/net/ programs/chimera/lib --with-tklibs=/net/programs/chimera/lib
make install for BLT is broken, and must be finished by hand; run make install, copy the libraries (.so) from /var/tmp/chimeraBuild/build/foreign/tcl8.4.2.16/lib to /net/programs/ chimera/lib, then move the /net/programs/chimera/lib/blt2.4 directory into /net/programs/chimera/lib/tcl8.4 it seems that the stuff in /var/tmp/chimeraBuild/build/foriegn... has to be there for this to work
-- David A. C. Beck, Ph.D. dacb@u.washington.edu Valerie Daggett Laboratory University of Washington, Seattle
On Mon, 3 Nov 2008, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas). But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget). It also might or might not be easier for you to provide BLT for NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Since the topic was examples, I have attached is a hacked out snippet from some of our code. It produces a window that reads some 2D data from a set of files. The hack comes in to make this code work outside of our module and read files instead of sockets / i/o buffers. Notice the hardcoded path: /tmp/chimera-dev@cgl.ucsf.edu where the files e.dat, ek.dat, ep.dat, secs.dat and t.dat need to exist. The format of these files is space separated two columns: the first being simulation timestep the second is the value (e.dat -> total energy, ek.dat -> kinetic energy, ep.dat -> potential energy, secs.dat -> time in seconds per simulation block, and t.dat -> temperature). The Add and Remove buttons are disabled. Only the mouseUp, mouseDrag and mouseDown methods are implemented. The python code is in 'plot2d.py' and the toolbar icon is 'plot.png'. YMMV. While I was looking at this, I noticed a note in my margin that says 'look at MinrmsPlot / ActivePlot.' So the original poster may be interested in looking at that code for some more plot window examples... -- David A. C. Beck, Ph.D. dacb@u.washington.edu Valerie Daggett Laboratory University of Washington, Seattle On Mon, 3 Nov 2008, Eric Pettersen wrote:
Hey, negative experiences are valuable to know about too! The more info we have for making a decision, the better. We do have practice with making recalcitrant builds bend to our will though. :-)
--Eric
On Nov 3, 2008, at 3:09 PM, David A. C. Beck wrote:
Sorry for the quick response, I can flesh it out in some more detail if anyone is interested...
We have used BLT2 to display 2D graphs from inside Chimera. The input are typically energies or other emissions as a function of simulation time from our simulation software (ilmm) that interfaces with Chimera. I never found a way to update the graph in real time (even though we can pump the data in over a socket from the simulation code). Instead the Pmw.Blt.Graph object has to be reloaded. There must be a way around this. The graphs are ugly and not in any way acceptable for publication.
The experience of getting everything to build against the correct headers and python libraries was frustrating. The distribution to machines in our lab is kludgy at best. I've never gotten it working under Windows or Mac. In case there is any doubt from my tone, we really don't like the BLT solution.
Some of my notes on getting it to work with an older version of Chimera:
BLT info:
Configure command for BLT to w/ with Daggett Lab chimera installation: ./configure --prefix=/net/programs/chimera/lib --with-tkincls=/net/programs/chimera/include --with-tclincls=/net/programs/chimera/include --with-blt=/net/programs/chimera/lib --with-tcllibs=/net/programs/chimera/lib --with-tklibs=/net/programs/chimera/lib
make install for BLT is broken, and must be finished by hand; run make install, copy the libraries (.so) from /var/tmp/chimeraBuild/build/foreign/tcl8.4.2.16/lib to /net/programs/chimera/lib, then move the /net/programs/chimera/lib/blt2.4 directory into /net/programs/chimera/lib/tcl8.4 it seems that the stuff in /var/tmp/chimeraBuild/build/foriegn... has to be there for this to work
-- David A. C. Beck, Ph.D. dacb@u.washington.edu Valerie Daggett Laboratory University of Washington, Seattle
On Mon, 3 Nov 2008, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas). But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget). It also might or might not be easier for you to provide BLT for NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Hi Eric and others, I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question: - using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin however, when I run Chimera's python manually, I see: $ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Why am I seeing 2 different Python builds? One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former). thanks, Randy On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
). But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...) ). It also might or might not be easier for you to provide BLT for NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

Hi Randy, On the Mac the Chimera python executable finds the Python framework and runs it. When you start Chimera's Python from a shell it is finding the Mac system Python framework instead of the one included in Chimera.app. The way Chimera gets its own Python framework instead of the system one is that the start-up script Chimera.app/Contents/Resources/bin/chimera sets the DYLD_FRAMEWORK_PATH environment variable to point to the Chimera Python (and Tcl/Tk) frameworks. We discussed including matplotlib in the Chimera distribution and agreed it is a good idea and we plan on doing it though a date has not been set. I would like to try using it this month or next month so I may add it to Chimera soon. The trick is to get it to build on all platforms (Windows, Linux, Mac). Have you built it for Chimera on Windows. Any tips? Thanks, Tom Randy Heiland wrote:
Hi Eric and others,
I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question:
- using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
however, when I run Chimera's python manually, I see:
$ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Why am I seeing 2 different Python builds?
One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former).
thanks, Randy
On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
).
But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...)
). It also might or might not be easier for you to provide BLT for
NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Thanks for clarifying, Tom. Am happy to hear you plan to eventually include mpl in Chimera. Yes, both Charlie (Moad) and I have built it for Windows, but that was several versions back when we did it regularly. What prompted this thread initially was my attempt to do it again, but discovered an apparent mismatch when Chimera jumped to Tcl/Tk 8.5 and mpl still wanted 8.4. Perhaps the inclusion of mpl into Chimera will be solved by the passage of time, after the libraries (and stars) align. Anyway, the only tips I'd have are the obvious ones - to tweak those checks/settings done in mpl's setup/setupext.py scripts related to the various dependencies (numpy, tcl/tk, etc) before running chimera's python on setup.py. Just running: ...path-to-chimera-python setup.py will reveal what mpl will attempt to use to build. Maybe I'll dust off my Window's laptop :) and make another attempt in the next few days. -Randy On Dec 16, 2008, at 1:16 PM, Tom Goddard wrote:
Hi Randy,
On the Mac the Chimera python executable finds the Python framework and runs it. When you start Chimera's Python from a shell it is finding the Mac system Python framework instead of the one included in Chimera.app. The way Chimera gets its own Python framework instead of the system one is that the start-up script
Chimera.app/Contents/Resources/bin/chimera
sets the DYLD_FRAMEWORK_PATH environment variable to point to the Chimera Python (and Tcl/Tk) frameworks.
We discussed including matplotlib in the Chimera distribution and agreed it is a good idea and we plan on doing it though a date has not been set. I would like to try using it this month or next month so I may add it to Chimera soon. The trick is to get it to build on all platforms (Windows, Linux, Mac). Have you built it for Chimera on Windows. Any tips?
Thanks,
Tom
Randy Heiland wrote:
Hi Eric and others,
I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question:
- using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
however, when I run Chimera's python manually, I see:
$ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/ Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Why am I seeing 2 different Python builds?
One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former).
thanks, Randy
On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
).
But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...)
). It also might or might not be easier for you to provide BLT for
NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Tom Goddard has done the work to get matplotlib to compile with Chimera. It's now available in the daily builds. --Eric On Dec 16, 2008, at 10:35 AM, Randy Heiland wrote:
Thanks for clarifying, Tom. Am happy to hear you plan to eventually include mpl in Chimera.
Yes, both Charlie (Moad) and I have built it for Windows, but that was several versions back when we did it regularly. What prompted this thread initially was my attempt to do it again, but discovered an apparent mismatch when Chimera jumped to Tcl/Tk 8.5 and mpl still wanted 8.4. Perhaps the inclusion of mpl into Chimera will be solved by the passage of time, after the libraries (and stars) align. Anyway, the only tips I'd have are the obvious ones - to tweak those checks/settings done in mpl's setup/setupext.py scripts related to the various dependencies (numpy, tcl/tk, etc) before running chimera's python on setup.py. Just running:
...path-to-chimera-python setup.py
will reveal what mpl will attempt to use to build.
Maybe I'll dust off my Window's laptop :) and make another attempt in the next few days.
-Randy
On Dec 16, 2008, at 1:16 PM, Tom Goddard wrote:
Hi Randy,
On the Mac the Chimera python executable finds the Python framework and runs it. When you start Chimera's Python from a shell it is finding the Mac system Python framework instead of the one included in Chimera.app. The way Chimera gets its own Python framework instead of the system one is that the start-up script
Chimera.app/Contents/Resources/bin/chimera
sets the DYLD_FRAMEWORK_PATH environment variable to point to the Chimera Python (and Tcl/Tk) frameworks.
We discussed including matplotlib in the Chimera distribution and agreed it is a good idea and we plan on doing it though a date has not been set. I would like to try using it this month or next month so I may add it to Chimera soon. The trick is to get it to build on all platforms (Windows, Linux, Mac). Have you built it for Chimera on Windows. Any tips?
Thanks,
Tom
Randy Heiland wrote:
Hi Eric and others,
I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question:
- using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
however, when I run Chimera's python manually, I see:
$ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/ Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Why am I seeing 2 different Python builds?
One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former).
thanks, Randy
On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
).
But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...)
). It also might or might not be easier for you to provide BLT for
NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Matplotlib is in current Mac and Linux Chimera daily builds but not yet in Windows. Should be in Windows within the next week. I'll send another message when it is. Tom Eric Pettersen wrote:
Tom Goddard has done the work to get matplotlib to compile with Chimera. It's now available in the daily builds.
--Eric
On Dec 16, 2008, at 10:35 AM, Randy Heiland wrote:
Thanks for clarifying, Tom. Am happy to hear you plan to eventually include mpl in Chimera.
Yes, both Charlie (Moad) and I have built it for Windows, but that was several versions back when we did it regularly. What prompted this thread initially was my attempt to do it again, but discovered an apparent mismatch when Chimera jumped to Tcl/Tk 8.5 and mpl still wanted 8.4. Perhaps the inclusion of mpl into Chimera will be solved by the passage of time, after the libraries (and stars) align. Anyway, the only tips I'd have are the obvious ones - to tweak those checks/settings done in mpl's setup/setupext.py scripts related to the various dependencies (numpy, tcl/tk, etc) before running chimera's python on setup.py. Just running:
...path-to-chimera-python setup.py
will reveal what mpl will attempt to use to build.
Maybe I'll dust off my Window's laptop :) and make another attempt in the next few days.
-Randy
On Dec 16, 2008, at 1:16 PM, Tom Goddard wrote:
Hi Randy,
On the Mac the Chimera python executable finds the Python framework and runs it. When you start Chimera's Python from a shell it is finding the Mac system Python framework instead of the one included in Chimera.app. The way Chimera gets its own Python framework instead of the system one is that the start-up script
Chimera.app/Contents/Resources/bin/chimera
sets the DYLD_FRAMEWORK_PATH environment variable to point to the Chimera Python (and Tcl/Tk) frameworks.
We discussed including matplotlib in the Chimera distribution and agreed it is a good idea and we plan on doing it though a date has not been set. I would like to try using it this month or next month so I may add it to Chimera soon. The trick is to get it to build on all platforms (Windows, Linux, Mac). Have you built it for Chimera on Windows. Any tips?
Thanks,
Tom
Randy Heiland wrote:
Hi Eric and others,
I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question:
- using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
however, when I run Chimera's python manually, I see:
$ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/ Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Why am I seeing 2 different Python builds?
One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former).
thanks, Randy
On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
).
But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...)
). It also might or might not be easier for you to provide BLT for
NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev

This is awesome guys! I look forward to trying it out... -Randy On Jan 14, 2009, at 1:49 PM, Thomas Goddard wrote:
Matplotlib is in current Mac and Linux Chimera daily builds but not yet in Windows. Should be in Windows within the next week. I'll send another message when it is.
Tom
Eric Pettersen wrote:
Tom Goddard has done the work to get matplotlib to compile with Chimera. It's now available in the daily builds.
--Eric
On Dec 16, 2008, at 10:35 AM, Randy Heiland wrote:
Thanks for clarifying, Tom. Am happy to hear you plan to eventually include mpl in Chimera.
Yes, both Charlie (Moad) and I have built it for Windows, but that was several versions back when we did it regularly. What prompted this thread initially was my attempt to do it again, but discovered an apparent mismatch when Chimera jumped to Tcl/Tk 8.5 and mpl still wanted 8.4. Perhaps the inclusion of mpl into Chimera will be solved by the passage of time, after the libraries (and stars) align. Anyway, the only tips I'd have are the obvious ones - to tweak those checks/settings done in mpl's setup/setupext.py scripts related to the various dependencies (numpy, tcl/tk, etc) before running chimera's python on setup.py. Just running:
...path-to-chimera-python setup.py
will reveal what mpl will attempt to use to build.
Maybe I'll dust off my Window's laptop :) and make another attempt in the next few days.
-Randy
On Dec 16, 2008, at 1:16 PM, Tom Goddard wrote:
Hi Randy,
On the Mac the Chimera python executable finds the Python framework and runs it. When you start Chimera's Python from a shell it is finding the Mac system Python framework instead of the one included in Chimera.app. The way Chimera gets its own Python framework instead of the system one is that the start-up script
Chimera.app/Contents/Resources/bin/chimera
sets the DYLD_FRAMEWORK_PATH environment variable to point to the Chimera Python (and Tcl/Tk) frameworks.
We discussed including matplotlib in the Chimera distribution and agreed it is a good idea and we plan on doing it though a date has not been set. I would like to try using it this month or next month so I may add it to Chimera soon. The trick is to get it to build on all platforms (Windows, Linux, Mac). Have you built it for Chimera on Windows. Any tips?
Thanks,
Tom
Randy Heiland wrote:
Hi Eric and others,
I've returned to this little exercise of trying to build matplotlib using Chimera and have a basic question:
- using the Chimera-1.3.2577-osx_aqua, when I bring up IDLE, I see: Python 2.5.2 (r252:60911, Dec 9 2008, 02:00:10) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
however, when I run Chimera's python manually, I see:
$ /Users/heiland/dev/Chimera-1.3.2577-osx_aqua.app/Contents/ Resources/ bin/python2.5 Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Why am I seeing 2 different Python builds?
One of the initial things I'm trying to resolve is the ability to 'import Tkinter'. I can do so from the former, but not the latter (even after setting sys.path to be what it is in the former).
thanks, Randy
On Nov 3, 2008, at 5:52 PM, Eric Pettersen wrote:
FYI, the last paragraph of my reply below may be of general interest to developers interested in plotting data...
On Oct 31, 2008, at 10:09 AM, Randy Heiland wrote:
Hi gang,
For one of the Chimera plugins that I now maintain, I'm considering eliminating the use of matplotlib and wondering if Chimera's innards are capable of doing what I want. For starters, are there any example plugins, etc that demonstrate how one could do simple plotting and simple (image) contours? In addition, I'd need to handle mouse events, e.g. to retrieve x,y positions on the contour image.
Hi Randy, I'm thinking that what Chimera currently provides will not be an adequate replacement for the capabilities of matplotlib that NLOPredict uses. Aside from the basic Tk widgets themselves (the most salient of which is Canvas) the only relevant widgets I can think of is an interactive histogram widget in CGLtk.Histogram, and a basic line/point plotting widget available through Scientific.TkWidgets.TkPlotCanvas (Scientific.TkWidgets.TkPlotCanvas<http://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scienti...
> ). > But I think NLOPredict needs interactive contour and bar graphs. As long as you can generate the contour image yourself somehow, I think you can pretty easily gin up an interactive contour plot using the Image item of Tk.Canvas. As for the bar graph, would BLT (A User's Guide to Pmw.Blt<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/>) provide enough functionality if we decided to provide that? It seems to provide bar charts (A complete reference to the Pmw.Blt plot widget<http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html%23bar_create(...)
> ). It also might or might not be easier for you to provide BLT > for > NLOPredict as a stopgap measure. So the Chimera developers will be discussing possibly providing some kind of plotting library at our next weekly meeting. Clearly, matplotlib is the "Cadillac" of plotting libraries. And like a Cadillac it has the downside of large size -- probably in the range of 60-80MB before compression. It also has the drawback of depending on a lot of other packages which we would also have to include and port to all our supported platforms, including 64-bit versions thereof. So I guess the question is whether we could get away with including something smaller like BLT, which we would also be able to deploy more quickly due to the lower effort involved, or do people really need the unique capabilities of matplotlib? Anybody?
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
participants (5)
-
David A. C. Beck
-
Eric Pettersen
-
Randy Heiland
-
Thomas Goddard
-
Tom Goddard