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():

[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

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

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 data

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

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 signal to

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 to

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 affects

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,

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 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

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 array

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 fromiter, but I

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

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

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. pylab

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. Sometimes