Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-20 Thread Fernando Perez
On Thu, Mar 18, 2010 at 6:39 PM, John Hunter  wrote:

> I also think the name should be changed, and there should be an entry
> in the matplotlib.figure.Figure API.  One additional suggestion is
> "subarray" and matplotlib.pyplot.subarray would be a thin wrapper to
> matplotlib.figure.Figure.add_subarray.  The former would return (fig,
> axarray) using gcf() to get the current figure, and the latter would
> simply create the subarray and return it.  The would break a bit with
> the pyplot "axes" and "subplot" commands that only return the Axes and
> Subplot instances (and not the implicit Figure instance created/used)
> but I can live with that because part of the goal here is to give easy
> access to axes and figure creation so the user can get in the habit of
> using the API directly for most things.
>
> As for the other name suggestions, I like "subplots".

Without further feedback, I went with John's vote on 'subplots' and
have committed the changes to the API as agreed, now naming it
plt.subplots().  I'm sorry but I didn't implement the full
Figure.add_subarray() changes you suggested, ran out of time...

There is, however, a fly in the ointment: while this new code feels
very nice from playing wtih it in scripts like the  example just
committed:

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/pylab_examples/subplots_demo.py?revision=8202&view=markup

it is NOT pleasant to use interactively, because the OO api requires
explicit draw() calls all the time.

I just realized  this now using it more, and  it's a  bummer, because
it makes it less likely that one will use this type of code in
everyday interactive exploration.

I wonder if it's possible to put things like a draw_if_interactive()
call at the end of the OO methods... I realize that pyplot was the
only one meant to do that, but if we are to encourage using the OO api
more, then it's going to have to be as pleasant to use as pyplot...  I
don't know the codebase well enough to mess with this right now, so I
hope someone who's more versed in that part of the code can make a fix
for this whose  impact isn't too severe on the runtime of OO code.

Cheers,

f

ps  - Chris, thanks for the encouragement :)

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Cameron Reid

2010-03-20 Thread Bairam Komaki
http://mobile-it.com.ar/Ben.html


  

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Elusive bug plotting masked arrays

2010-03-20 Thread David J. Raymond
On Fri, Mar 19, 2010 at 05:47:05PM -1000, Eric Firing wrote:
> David J. Raymond wrote:
> >I am using python 2.5.5 and the gtk background (as far as I can tell).
> >Turning off path.simplify gets rid of the extraneous line.  I am
> >attaching pngs with path.simplify both on and off.  I am also
> >attaching the full coastline file that produced the original problem.
> >I noticed that the behavior was a bit weird, with the bad line
> >appearing or disappearing in apparently random ways depending on what
> >was edited out of the input file.
> 
> This looks to me like a bug that Mike fixed, maybe the one where a
> path was not always starting with a move_to.  That was fixed on
> October 22.

Would this fix have made it into version 0.99.1.2 which I am currently
using?

Dave

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Elusive bug plotting masked arrays

2010-03-20 Thread Eric Firing
David J. Raymond wrote:
> On Fri, Mar 19, 2010 at 05:47:05PM -1000, Eric Firing wrote:
>> David J. Raymond wrote:
>>> I am using python 2.5.5 and the gtk background (as far as I can tell).
>>> Turning off path.simplify gets rid of the extraneous line.  I am
>>> attaching pngs with path.simplify both on and off.  I am also
>>> attaching the full coastline file that produced the original problem.
>>> I noticed that the behavior was a bit weird, with the bad line
>>> appearing or disappearing in apparently random ways depending on what
>>> was edited out of the input file.
>> This looks to me like a bug that Mike fixed, maybe the one where a
>> path was not always starting with a move_to.  That was fixed on
>> October 22.
> 
> Would this fix have made it into version 0.99.1.2 which I am currently
> using?
> 
> Dave

No, it is not there.  Can you build from svn?

Eric

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] gtk.Tooltips() deprecated

2010-03-20 Thread Ryan May
Hi,

I just started running PyGTK 2.16 and noticed the following everytime
I run a matplotlib script:

/home/rmay/.local/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()

Right now, we support >= PyGTK 2.2.  The new, non-deperecated API
(gtk.Tooltip) was added in 2.12 (and the gtk.Tooltips API was
deprecated at this time).  So, my question is how do we want to handle
this?  Do we want to create a helper method that hides the logic to
determine what method to use (there doesn't look to be an easy way to
support both)? Or do we just bump our required version? 2.12.0 was
released in fall 2007. I'm not sure what versions are supplied with
the various distros.

Thoughts?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] gtk.Tooltips() deprecated

2010-03-20 Thread Eric Firing
Ryan May wrote:
> Hi,
> 
> I just started running PyGTK 2.16 and noticed the following everytime
> I run a matplotlib script:
> 
> /home/rmay/.local/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
> DeprecationWarning: Use the new widget gtk.Tooltip
>   self.tooltips = gtk.Tooltips()
> 
> Right now, we support >= PyGTK 2.2.  The new, non-deperecated API

pygtk_version_required = (2,4,0)

> (gtk.Tooltip) was added in 2.12 (and the gtk.Tooltips API was
> deprecated at this time).  So, my question is how do we want to handle
> this?  Do we want to create a helper method that hides the logic to
> determine what method to use (there doesn't look to be an easy way to
> support both)? Or do we just bump our required version? 2.12.0 was
> released in fall 2007. I'm not sure what versions are supplied with
> the various distros.
> 

My sense is that RHEL4 is still common, and will be supported by RH 
through early 2012 (http://www.redhat.com/security/updates/errata/).  It 
is way back at pygtk 2.4.

I just now committed to svn a little bit of conditional code to support 
the new api along with the old one.  Minimal testing on my system (new 
api) looks OK; more testing with new API, and testing with pygtk < 2.12, 
are needed.  The changes are extremely simple, but I might have 
overlooked something.

Eric

> Thoughts?
> 
> Ryan
> 


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-20 Thread Jae-Joon Lee
On Sat, Mar 20, 2010 at 5:05 AM, Fernando Perez  wrote:
> I wonder if it's possible to put things like a draw_if_interactive()
> call at the end of the OO methods... I realize that pyplot was the
> only one meant to do that, but if we are to encourage using the OO api
> more, then it's going to have to be as pleasant to use as pyplot...  I
> don't know the codebase well enough to mess with this right now, so I
> hope someone who's more versed in that part of the code can make a fix
> for this whose  impact isn't too severe on the runtime of OO code.

I'm not very inclined to this but I'll wait to hear what others think.
I use oo api in the interactive mode but I still prefer to call draw()
explicitly.
Of course, we can make it optional.

By the way, given that we now have "suplots" in the pyplot namespace,
can we have sca also?
For example,

 # Two subplots, the axes array is 1-d
 f, axarr = subplots(2, sharex=True)

 sca(axarr[0])
 plot(x, y)
 title('Sharing X axis')

 sca(axarr[1])
 scatter(x, y)

Or, how about we make axes an context manager.

 # Two subplots, the axes array is 1-d
 f, axarr = subplots(2, sharex=True)

 with axarr[0]:
   plot(x, y)
   title('Sharing X axis')

 with axarr[1]:
   scatter(x, y)

This may not very useful in the interactive mode, but may make a
script (written in pylab mode) more readable.

Regards,

-JJ

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-20 Thread Eric Firing
Jae-Joon Lee wrote:

> 
> By the way, given that we now have "suplots" in the pyplot namespace,
> can we have sca also?

Done in svn 8205.

> For example,
> 
>  # Two subplots, the axes array is 1-d
>  f, axarr = subplots(2, sharex=True)
> 
>  sca(axarr[0])
>  plot(x, y)
>  title('Sharing X axis')
> 
>  sca(axarr[1])
>  scatter(x, y)
> 
> Or, how about we make axes an context manager.

This would require dropping support for Python 2.4.

Eric

> 
>  # Two subplots, the axes array is 1-d
>  f, axarr = subplots(2, sharex=True)
> 
>  with axarr[0]:
>plot(x, y)
>title('Sharing X axis')
> 
>  with axarr[1]:
>scatter(x, y)
> 
> This may not very useful in the interactive mode, but may make a
> script (written in pylab mode) more readable.
> 
> Regards,
> 
> -JJ

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] gtk.Tooltips() deprecated

2010-03-20 Thread Ryan May
On Sat, Mar 20, 2010 at 5:53 PM, Eric Firing  wrote:
> Ryan May wrote:
>>
>> Hi,
>>
>> I just started running PyGTK 2.16 and noticed the following everytime
>> I run a matplotlib script:
>>
>>
>> /home/rmay/.local/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
>> DeprecationWarning: Use the new widget gtk.Tooltip
>>  self.tooltips = gtk.Tooltips()
>>
>> Right now, we support >= PyGTK 2.2.  The new, non-deperecated API
>
> pygtk_version_required = (2,4,0)

Ok. I got my number from our install docs:
http://matplotlib.sourceforge.net/users/installing.html#build-requirements
There it says PyGTK 2.2 as a (optional) build dependency.

>> (gtk.Tooltip) was added in 2.12 (and the gtk.Tooltips API was
>> deprecated at this time).  So, my question is how do we want to handle
>> this?  Do we want to create a helper method that hides the logic to
>> determine what method to use (there doesn't look to be an easy way to
>> support both)? Or do we just bump our required version? 2.12.0 was
>> released in fall 2007. I'm not sure what versions are supplied with
>> the various distros.
>>
>
> My sense is that RHEL4 is still common, and will be supported by RH through
> early 2012 (http://www.redhat.com/security/updates/errata/).  It is way back
> at pygtk 2.4.
>
> I just now committed to svn a little bit of conditional code to support the
> new api along with the old one.  Minimal testing on my system (new api)
> looks OK; more testing with new API, and testing with pygtk < 2.12, are
> needed.  The changes are extremely simple, but I might have overlooked
> something.

Awesome, works great here, thanks.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] gtk.Tooltips() deprecated

2010-03-20 Thread Eric Firing
Ryan May wrote:
> On Sat, Mar 20, 2010 at 5:53 PM, Eric Firing  wrote:
>> Ryan May wrote:
>>> Hi,
>>>
>>> I just started running PyGTK 2.16 and noticed the following everytime
>>> I run a matplotlib script:
>>>
>>>
>>> /home/rmay/.local/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
>>> DeprecationWarning: Use the new widget gtk.Tooltip
>>>  self.tooltips = gtk.Tooltips()
>>>
>>> Right now, we support >= PyGTK 2.2.  The new, non-deperecated API
>> pygtk_version_required = (2,4,0)
> 
> Ok. I got my number from our install docs:
> http://matplotlib.sourceforge.net/users/installing.html#build-requirements
> There it says PyGTK 2.2 as a (optional) build dependency.

Fixed in svn, thanks.

Eric

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel