Trellis-style plots


Thanks for the suggestions. I remember now reading about RSPython, but I
hadn't considered it.

I guess one of my goals is to be able to share my analysis tools with my
coworkers, and requiring them to set up R to use the tools adds some
headaches. (Unless there's an "R2exe" I haven't heard about!)
Python+matplotlib+wxpython+py2exe would be great for sharing my tools with
other users.

My datasets can be large for a PC, so having to move the data between
numarray and R probably means making copies and swapping, unless I'm careful
about subsetting on the numarray side before handing off data to be Trellis
plotted. Also, some of the data I'm analyzing is written by (black-box)
measurement equipment, and I've found it tricky to implement a pure-R file
reader in some cases. Python+numarray seems better with respect to file

I really like the interactivity and the quality of the matplotlib backends,
and I'd be giving those up taking the RSPython route. However, R can write
Enhanced Metafiles, which I use quite a bit since we're an MS Office shop.

You're right that a lot of the expressiveness in S+Trellis is in the formula
notation, and that would be some work to replicate in Python. For the
relatively simple stuff I do, RecArrays seem like a good equivalent to
data.frames, and subscripting RecArrays can function like a formula spec in

So, those are my thoughts on what I'd gain and lose by going to
Python+matplotlib from R. If I've got some misconceptions or if there are
other options I've not considered, I'd like to know.

Best regards,


--------- Original Message --------
From: "Chris Neff" <caneff@...287...>
To: "John Pitney" <john@...678...>
Subject: Re: [Matplotlib-users] Trellis-style plots
Date: 11/07/05 04:48

Hi John,

Any reason why you need to use matplotlib to do this? In my view of
things it would be easier to use R itself with the RSPython package:

This way you can get whatever you want done in python and then just
plot the results in R. This is vastly preferable as there is no
formula expressions in Python as there are in R, and that is 95% of
Trellis's power. I guess you could cook up the formula capability
yourself, but why bother?

If you could explain a little more on what you want to do, I could
probably give the best course of action.

-Chris Neff

On 10/07/05, John Pitney <john@...678...> wrote:


I'm a new user of matplotlib, and I'm trying to learn how to do some of
the things I'm accustomed to doing in the R environment with matplotlib
and numarray. I find R's Lattice implentation of Trellis graphics very
useful in my industrial data analysis work.

For those unfamiliar with Trellis, here's the user manual:

Does anyone have any experience with making conditioned plots or
scatterplot matrices with matplotlib? I'd like to try them out with
matplotlib and would appreciate seeing any code that's already out there.

Thanks to the matplotlib developers for what looks like a great tool!

Best regards,