[SciPy-user] SciPy and GUI

Gael Varoquaux gael.varoquaux at normalesup.org
Mon Jan 26 10:12:03 EST 2009


Quickly,

On Mon, Jan 26, 2009 at 08:30:39AM -0600, Dharhas Pothina wrote:
> I've read your tutorial using traits and matplotlib and also a little
> bit of some of the Chaco examples. But I'm struggling to decide whether
> to go with traits + matplotlib or with chaco. I've also read some of the
> older mailing list discussions about chaco and matplotlib but those
> don't focus so much on GUI applications.

> On one hand, I am already using matplotlib and the timeseries toolkit
> extensively in scripts so I'm familiar with them and know that they can
> make pretty much any type of plot I need. Also matplotlib has a large
> community.

> On the other hand, chaco seems to have been designed for this type of
> interactive application and the plots I need for the GUI app are simpler
> and are supported by Chaco.

> Do you (or any others) have any comments about the pros and cons of
> each for someone new at this stuff. 

Matlplotlib has a huge user base and an excellent documentation. It can
be inserted in Traits (I have shown it in my tutorial). It is suitable
for GUI developement with Traits. Many people have done it, including me.

On the other hand, matplotlib's model is very much imperative and
script-based. This makes it easy to understand, but really is not the
right paradigm for interactive applications in an object-oriented
language. Chances are that, unless you are very experienced with the MVC
pattern and interactive application design, you will make architectural
errors when building an interactive application with Matplotlib. Chaco
will constrain you, force you to do things according to its model, which
you will hate (we all did at some point), but later on you will be happy
that it enforced on you some object-oriented structure, on some
separation of concerns (think model-view-controller, which can be
transcribed in terms of data-plot-interactor in Chaco). In addition, the
fact that Chaco plugs into Traits seemlessly gives you a huge amount of
benefit for interactivity. The focus switches from registering callbacks
all over the place to reactive programming on attribute modification.

Now all this nice and fancy architecture, this "Good" design, and so
forth, you may not actually care about, if your application is
simple-enough. A poorly designed application has difficulties growing,
but what if it will never grow? I could draw a scale with increasing
interactivity and complexity, and we could argue where to put the line
delimiting Matplotlib land and Chaco land. I use both.

Another win of Chaco is speed. You might not care either.

Chaco used to be really poorly documented. Things are improving a lot
(http://code.enthought.com/projects/chaco/documentation.php).

The developers are responsive, on the enthought-dev mailing list. Quite a
few people have made the choice of Chaco, and been very happy with it.

I can't decide for you, sorry. If you are going to code something large
and long-lived, I suggest you spend a few days coding 'hello word'
applications in both, exploring things similar to what you will need to
code in your final app, and make the decision afterward. The time spent
doing this will be neglectible compared to the time spent coding a big
app. If you are going to code a very small app, it doesn't really matter.

Good luck,

Gaël



More information about the SciPy-User mailing list