|
From: Tony S Yu <to...@MI...> - 2008-06-29 23:10:53
|
Hi. A couple of questions about `scatter`: Q1 ==== The bounding box `axes.dataLim` increases in size when calling scatter(x, y) compared to plot(x, y) (for the same x, y data, of course). I think this change is due to the size of the markers being added to the data limits (not sure if this is true). Is there an easy way to get the same data limits I would have for a call to `plot`? Q2 ==== Is there a way to get the data from the axes of a scatter plot? Initially I thought I could get it with: >>> for collection in ax.collections: >>> for path in collection._paths: >>> print path.vertices But this seems to be the path that draws the scatter markers. Any ideas? Frame Class ========== Finally, if anyone is interested, I'm playing around with a Frame class for `axes.frame`. This class adds customizable axes frames similar to the topic of this thread: http://sourceforge.net/mailarchive/message.php?msg_id=87d57vjgye.fsf%40peds-pc311.bsd.uchicago.edu In this older thread, the SAGE axes frames were criticized for not being flexible enough. I've tried to make this class as general as possible (within my ability:). As an example of the flexibility of this Frame class, I've added some Tufte-style frames similar to: http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/ To the developers on this thread: If there's anything I could do to make the attached Frame class more flexible (and more suitable for possible inclusion into MPL), I'd be happy to get some feedback. Current Limitations: ================ * the frame can only be placed on the borders of the axes (mainly because I don't know how to move the tickers anywhere else). * RangeFrame only works with linear data (I'm not sure how to use the `axes.transScale` to properly transform the data) * RangeFrame and DashDotFrame don't work properly with `scatter` (because of the questions in this post). The frame class itself isn't too long, but I got a little carried away adding in extra crap. Sorry for the long, rambling email.;) -Tony |