From: Neil Pilgrim <matplotlib@ke...> - 2005-12-12 23:57:47
I've been giving matplotlib (0.85) a spin, as a front end for
'exploring' scientific simulation results. Now I've got the data in and
had a play, there's been a few things which have confused me somewhat
about the API/features:
* Is there the equivalent of [axes].set_ydata(), but for contours or
other 3d-data plots?
* pcolor seems slow, and for some reason it defaults to automatically
selecting a different (overly large) automatic axis-range than
contour[f] - even if it has the X&Y data. I have an irregular mesh, so
I'm not sure that imshow will work properly on its own, even if I set
the data range in some way.
* For some reason my install leaves me with pylab windows which have no
proper icons in the bottom button bar. I've set MATPLOTLIBDATA and
PYTHONPATH, since I installed the modules into a subdir of my home
* Closing the pylab windows using the window-manager results in the
python process continuing - should this be calling some function to
interrupt the show() function? (I'm running GTK/GTKAgg if its relevant)
Nevertheless, even with these annoyances, I'm quite happy with the
results so far - it is perhaps already simpler than the system I had
been using previously, and has taken very little time to get to grips
Having said that, I'm not entirely clear whether pylab is intended to be
'the' interface to matplotlib, or just a simplified front-end - it seems
quite confusing from reading some of the online documents.
Thanks for matplotlib, (I'll think of other things to ask, in time!)
From: Ken McIvor <mcivor@ii...> - 2005-12-14 17:10:57
On Dec 12, 2005, at 5:56 PM, Neil Pilgrim wrote:
> * Is there the equivalent of [axes].set_ydata(), but for contours
> or other 3d-data plots?
I don't think there's a way to change the data associated with a
contour plot, but plotting with imshow() returns an AxesImage object
that you can set_data() on. This is no set_extent() method, so if
you are also specifying an extent you will need to update it directly
by setting "img._extent = (xmin, xmax, ymin, ymax)".
> I have an irregular mesh, so I'm not sure that imshow will work
> properly on its own, even if I set the data range in some way.
There's a cookbook entry about dealing with this situation:
I also recall hearing something about support for irregularly spaced
data being added, but it may still be in CVS. Sourceforge just went
down, so I can't check the ChangeLog and tell you for certain. :-/
> Having said that, I'm not entirely clear whether pylab is intended
> to be
> 'the' interface to matplotlib, or just a simplified front-end - it
> quite confusing from reading some of the online documents.
In my last email, I forgot to add that I rewrote a bunch of the demos
to the OO API for plotting (pylab is still used to get the Figure):