|
From: John H. <jdh...@ac...> - 2004-08-17 17:59:52
|
>>>>> "Thomas" == Thomas Barket <tho...@ya...> writes:
Thomas> Hello, I am fairly new to matplotlib in particular and
Thomas> using gui's in general and don't have much experience yet
Thomas> with threading. From a python command prompt, I want to
Thomas> be able to use python to create and work with data sets,
Thomas> while simultaneously be able to chart the data with
Thomas> matplotlib. Since I would like to display more than one
Thomas> matplotlib chart at a time, I presume this involves
Thomas> working with threads. Furthermore, I would like to also
Thomas> display the data sets in a grid-like table, and since I
Thomas> want to see more than one such grid-like table at a time
Thomas> (and of course see grid-like tables and matplotlib charts
Thomas> at the same time too), I think this will also involve
Thomas> threading.
Have you had a chance to read
http://matplotlib.sourceforge.net/interactive.html? This gives a
little background on using matplotlib interactively.
As stated on that page, the best approach with the current matplotlib
(0.61) is to set
backend : TkAgg
interactive : True
in your matplotlibrc file
(http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC). If you do
this, you will not need to call show.
Fernando Perez, author of ipython, is working on a much improved
interactive shell for matplotlib + GTK. He plans eventually to
support all the backends, but right now is focusing on GTK (tkagg
already works with ipython). You will need CVS ipython and CVS
matplotlib to try this out, but it is very nice. See his earlier post
http://sourceforge.net/mailarchive/forum.php?thread_id=5323260&forum_id=33405
As for the grids, if I understand you correctly, the best way to do
this is create multiple axes with the subplot command, eg,
from matplotlib.matlab import *
subplot(221) # upper left
plot(range(10), 'go')
subplot(222)
pcolor(rand(10,10)) # upper right
subplot(223)
scatter(rand(12), rand(12)) # lower left
subplot(224)
hist(randn(10000), 100) # lower right
show()
Is this what you are looking for? [You can embed multiple matplotlib
figure canvases into a wx grid or a gtk.Table if you want to use the
GUI API, but I'm assuming you're looking for something simpler, as
above].
JDH
|