[Matplotlib-users] Beginner OSX Question

2007-03-02 Thread Ranjan Bagchi
Hi -- I'm just starting with matplotlib and scipy on a Mac. I was able to get some plots to work under X (using the gtk+ renderer), but I wanted to avoid that and use CocoaAgg (that's the best option for mac, right?) When using the default renderer, it looks like the window (under X11) was in

Re: [Matplotlib-users] New aspect function for pylab

2007-03-02 Thread Eric Firing
Christopher Barker wrote: [...] > It is nice to have a really simple plot command. What would it do if we > were trying to be fully OO? My key question is whether it would return > and axis, a figure or both: > > Fig, ax = plot([1,2,3]) > > then: > > ax.xlabel("whatever") > > isn't bad for me

Re: [Matplotlib-users] New aspect function for pylab

2007-03-02 Thread Christopher Barker
John Hunter wrote: > On 2/27/07, Christopher Barker <[EMAIL PROTECTED]> wrote: >> There is nothing inherent in OO >> design that makes it necessary to write a bunch more code. > > I don't agree with this at all. Inherent in OO design is object > creation, attribute setting and method calling.

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Simon Wood
On 3/2/07, John Hunter <[EMAIL PROTECTED]> wrote: John said: ...here is the minimal interface that appears to work class C(object): def __init__(self): self._data = (1,2,3,4,5) def __getitem__(self, i): return self._data[i] def __len__(self): return len(se

Re: [Matplotlib-users] imshow y axis question

2007-03-02 Thread Suresh Pillai
On Thu, 1 Mar 2007, Eric Firing wrote: > I agree, and this is a problem with spy also. If I remember, I will fix it. > It is only a minor annoyance, so it is low priority, though. > > There is a difference in the way the axes are labeled between spy and > matshow, and I would like to change m

[Matplotlib-users] axes3d - very slow interactive use...

2007-03-02 Thread Marek Wojciechowski
Hi! I created scatter3d plot with ca. 2000 points and i'm experiencing very, very slow behavior in the interactive window. Rotate/move/zoom options are not usable actually. Does anyone else experience this problem? -- Marek Wojciechowski -

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread John Hunter
On 3/2/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > John asked: > > What is the minimum interface for an object to be > > converted to a numpy sequence via as array? > > The class must inherit from object. > That will probably do it. > If all else fails, try fromiter. > I know it works with fromi

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Pierre GM
On Friday 02 March 2007 14:12:24 John Hunter wrote: > I still am not able to make my mock-up custom python class work as I > would like with asarray (though it works with "list"). What am I > missing? The way I read it this appears to be in support of extension > code that wants to expose the ar

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Alan Isaac
John asked: > What is the minimum interface for an object to be > converted to a numpy sequence via as array? The class must inherit from object. That will probably do it. If all else fails, try fromiter. Alan Isaac - Take

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread John Hunter
On 3/2/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > This sounds like EXACTLY the type of object that the array interface is > supposed to support. So what you need to do is give your object an array > interface: > > http://numpy.scipy.org/array_interface.shtml I still am not able to make m

Re: [Matplotlib-users] Axes label

2007-03-02 Thread Jouni K . Seppänen
[EMAIL PROTECTED] writes: > The method proposed by Jouni appears to work too: > gca().yaxis.set_major_locator(LinearLocator()) > but it created too many labels. It's just the default behavior. Please see http://matplotlib.sourceforge.net/matplotlib.ticker.html#LinearLocator or simply query the

Re: [Matplotlib-users] Axes label

2007-03-02 Thread kc106_2005-matplotlib
Thanks to the reply, John (Hunter). That's it. The method proposed by Jouni appears to work too: gca().yaxis.set_major_locator(LinearLocator()) but it created too many labels. The set_ytinks call is the key. The set_ylim doesn't seem to be necessary. Now I have to study and see how I can i

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Christopher Barker
John Hunter wrote: > But numpy.asarray, which is what mpl uses to convert inputs to > arrays, The whole idea of asarray, is that it should be able to convert properly defined objects without even copying the data. > my own custom class which contains data members, methods and an array > of data (

Re: [Matplotlib-users] Axes label

2007-03-02 Thread John Hunter
On 3/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Somebody at the usenet suggested that I play with the ticker formatter and > locator. While that helped the multi-color sample I cited, it didn't help > in my plots. The formatter only controls how the y-axis labels are > formatted, w

Re: [Matplotlib-users] Axes label

2007-03-02 Thread Jouni K . Seppänen
[EMAIL PROTECTED] writes: > Somebody at the usenet suggested that I play with the ticker > formatter and locator. While that helped the multi-color sample I > cited, it didn't help in my plots. The formatter only controls how > the y-axis labels are formatted, whereas AFAIK the locator only > affe

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread John Hunter
On 3/2/07, Simon Wood <[EMAIL PROTECTED]> wrote: python > Out of the box matplotlib works great with Numeric and numarray data types. > However, I have my own custom class which contains data members, methods and > an array of data (underlying C array). Is there a way to expose the C array > data

Re: [Matplotlib-users] Axes label

2007-03-02 Thread kc106_2005-matplotlib
Somebody at the usenet suggested that I play with the ticker formatter and locator. While that helped the multi-color sample I cited, it didn't help in my plots. The formatter only controls how the y-axis labels are formatted, whereas AFAIK the locator only affects the values of the ymajor a

Re: [Matplotlib-users] How to make figures transparent by default, leave foreground color to pdflatex?

2007-03-02 Thread Jouni K . Seppänen
Jouni K. Seppänen <[EMAIL PROTECTED]> writes: > Anand Patil <[EMAIL PROTECTED]> writes: >> - When I inserted some of my old pdf plots into a latex presentation, to >> my surprise their foreground color had changed from black to the color >> of the text in the presentation. Is there a way to sign

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Glen W. Mabey
On Fri, Mar 02, 2007 at 08:46:24AM -0600, Glen W. Mabey wrote: > P.S. You may also need to implement functions like __len__; if these > concepts are well-defined for your class, then it should be a very > straightforward process. But the problem is (if your experience is similar to mine) that then

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Glen W. Mabey
On Fri, Mar 02, 2007 at 08:44:02AM -0600, Glen W. Mabey wrote: > One approach that I've used recently is to simply provide functionality > for the [] operator (done by implementing the __getslice__ member > function) that accesses the data according to standard slicing rules. > Then, you can use pl

Re: [Matplotlib-users] Plot data from custom class

2007-03-02 Thread Glen W. Mabey
On Fri, Mar 02, 2007 at 09:41:03AM -0500, Simon Wood wrote: > Out of the box matplotlib works great with Numeric and numarray data types. > However, I have my own custom class which contains data members, methods and > an array of data (underlying C array). Is there a way to expose the C array > da

Re: [Matplotlib-users] How to make figures transparent by default, leave foreground color to pdflatex?

2007-03-02 Thread Jouni K . Seppänen
Anand Patil <[EMAIL PROTECTED]> writes: > - How can I make my figures and axes transparent by default? Here's one idea: In [1]:fig=figure(frameon=False) In [2]:ax = fig.add_subplot(111, frameon=False) In [3]:ax.plot([3,1,

[Matplotlib-users] Plot data from custom class

2007-03-02 Thread Simon Wood
Out of the box matplotlib works great with Numeric and numarray data types. However, I have my own custom class which contains data members, methods and an array of data (underlying C array). Is there a way to expose the C array data to the plot() routines? For example I would like to be able to u

Re: [Matplotlib-users] invalidrestore - PDF

2007-03-02 Thread Jouni K . Seppänen
[EMAIL PROTECTED] writes: > a) 2.3 doesn't have the sorted function - it uses a .sort() > function. So, I had to change line 487 from: I think this was taken care of by Nicolas Grilly's recent patch. > b) No update() function (line 396) > for (name, value) in self.markers.items(): >