[Matplotlib-users] Remove Toolbar state

2010-06-22 Thread David Morton
Hello,

I have Matplotlib running embedded in a wxPython app with the ability
to show/hide the toolbar.  When I hide the toolbar the current tool
remains active (i.e. zooming) even though the toolbar is invisible.
Is there a way to turn off the tools when I hide the toolbar?

The toolbar I'm using is
matplotlib.backends.backend_wxagg.NavigationToolbar2WxAgg

Thanks,
David Morton

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Stephen George

>> However if I am zoomed in on my graph looking at detail, then click the
>> radio button, the scatter plot forces the graph to resize to once again
>> show the overall intial view (zoomed out).
>>  
> Try using:
>
> axes.set_autoscale_on(False)
>

Thank you very much, this does exactly what I was after.

I call this BEFORE adding my scatter plot, and the current view (zoom 
in) remains.

Much appreciated, thanks again

- Steve

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] selecting part of a contour to plot

2010-06-22 Thread Jae-Joon Lee
contour creates list of LineCollection objects (per each level I
suppose) which is stored in "collections" attribute. For example,

cntr = contour(A, levels)

then

cntr.collections[i] is a LineCollection objects that is associated
with levels[i].

And you can change colors of each line in the LineCollection object
with set_edgecolors method.

So, assuming that there is two contour lines for the first level.

cntr.collections[0].set_edgecolors(["none", "r"])

will change the color of the first contour to "none" (i.e., not drawn)
and the second one to red.

But you need to figure out which one is the one you want.

IHTH,

-JJ


On Tue, Jun 22, 2010 at 2:46 PM, Jonathan Slavin
 wrote:
> To all:
>
> I'm making a plot with an image and a contour on it.  I use only one
> level in the call to contour, but it results in two distinct contours,
> an inner closed one and an outer open one.  I want to plot only the
> outer piece.  How might I go about that?  I've been looking at the
> properties of the ContourSet object returned by the call to contour but
> can't find anything useful yet.  Is there an attribute of ContourSet
> objects that contains the (x,y) values for the contour?  Is there some
> way to see that a ContourSet object has separate pieces?
>
> Any help would be appreciated.
>
> Thanks,
> Jon
>
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Ryan May
On Tue, Jun 22, 2010 at 8:56 PM, Stephen George
 wrote:
> I have an application that draws a line plot of  a spectrum. When the
> spectrum is collected different gains and filters may be used for each
> data point (which I have also collected). I am looking at artefacts in
> the spectrum and trying to correlate them with things such as the gain
> and filter changes etc.
>
> On the application I have a number of radio buttons, when clicked will
> add a scatter plot of the datapoints but color coded by the item of
> interest.
> i.e.
> click the gain btn  I end up with the line plot, and each data point has
> a color coded dot whose color is keyed to the gain the data point was
> taken at.
> click the filter btn  I remove the gain scatter plot, and add a filter
> scatter plot where each data point is color coded with the filter used.
>
> This functionality work fine.
>
> However if I am zoomed in on my graph looking at detail, then click the
> radio button, the scatter plot forces the graph to resize to once again
> show the overall intial view (zoomed out).

Try using:

axes.set_autoscale_on(False)

Ryan

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

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Benjamin Root
Stephen,

Most likely, the program isn't really going back to the "original" axes as
much that it is automatically setting the axes to fit all the data from the
new plot (which would likely be the "original axes", but only by
coincidence).  I am sure there is some sort of easy way to do this, but the
brute-force way would be for any action to create a plot to first check and
see what the current x and y lims are and save them to temporary variables.
Then, after creating the plots, call set the x and y lims from the temporary
variables.

Note that there might be an issue with the first graph, because you don't
want to set the axes after creating the graph using the information prior to
the graphing.  I don't know how one would detect that, besides some sort of
counter and an if-statement.

Maybe someone else has a better way?

Ben Root


On Tue, Jun 22, 2010 at 8:56 PM, Stephen George
wrote:

>
> Hi,
>
> I have an application that draws a line plot of  a spectrum. When the
> spectrum is collected different gains and filters may be used for each
> data point (which I have also collected). I am looking at artefacts in
> the spectrum and trying to correlate them with things such as the gain
> and filter changes etc.
>
> On the application I have a number of radio buttons, when clicked will
> add a scatter plot of the datapoints but color coded by the item of
> interest.
> i.e.
> click the gain btn  I end up with the line plot, and each data point has
> a color coded dot whose color is keyed to the gain the data point was
> taken at.
> click the filter btn  I remove the gain scatter plot, and add a filter
> scatter plot where each data point is color coded with the filter used.
>
> This functionality work fine.
>
> However if I am zoomed in on my graph looking at detail, then click the
> radio button, the scatter plot forces the graph to resize to once again
> show the overall intial view (zoomed out).
>
> I am wondering how can I add the scatter plot, without changing the
> current view (zoom level) that I am currently using, but still add all
> the scatter plot data?
>
> Any suggestions gratefully accepted.
>
> Steve
>
>
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Stephen George

Hi,

I have an application that draws a line plot of  a spectrum. When the 
spectrum is collected different gains and filters may be used for each 
data point (which I have also collected). I am looking at artefacts in 
the spectrum and trying to correlate them with things such as the gain 
and filter changes etc.

On the application I have a number of radio buttons, when clicked will 
add a scatter plot of the datapoints but color coded by the item of 
interest.
i.e.
click the gain btn  I end up with the line plot, and each data point has 
a color coded dot whose color is keyed to the gain the data point was 
taken at.
click the filter btn  I remove the gain scatter plot, and add a filter 
scatter plot where each data point is color coded with the filter used.

This functionality work fine.

However if I am zoomed in on my graph looking at detail, then click the 
radio button, the scatter plot forces the graph to resize to once again 
show the overall intial view (zoomed out).

I am wondering how can I add the scatter plot, without changing the 
current view (zoom level) that I am currently using, but still add all 
the scatter plot data?

Any suggestions gratefully accepted.

Steve


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] selecting part of a contour to plot

2010-06-22 Thread Benjamin Root
Actually, I just re-read your original message and noticed that you were
specifying your levels (I believe).  The double set of contours depends on
what your values are.  If you want to make absolutely sure that there aren't
extra lines, you could contour a boolean array:

contour(x, y, z > 4.5, [0, 1])

That should do the trick as well (assuming you know the level that you want
the isopleth for).

Ben Root

On Tue, Jun 22, 2010 at 6:27 PM, Benjamin Root  wrote:

> Jon,
>
> One thing you can do is to manually specify the levels to contour for in
> the contour call, or just specify the number of contours (and contour() will
> figure out the levels for you).  The fourth argument to contour() allows you
> to give a sequence of values (or an integer) for the isopleths.  So, if you
> want just one line (but have it chosen automatically):
>
> contour(x, y, z, 1)
>
> If you want a contour to always be for the value of 4.5, for example, then:
>
> contour(x, y, z, [4.5])
>
> Should do the trick.
>
> I hope that helps,
> Ben Root
>
>
>
>
> On Tue, Jun 22, 2010 at 1:46 PM, Jonathan Slavin 
> wrote:
>
>> To all:
>>
>> I'm making a plot with an image and a contour on it.  I use only one
>> level in the call to contour, but it results in two distinct contours,
>> an inner closed one and an outer open one.  I want to plot only the
>> outer piece.  How might I go about that?  I've been looking at the
>> properties of the ContourSet object returned by the call to contour but
>> can't find anything useful yet.  Is there an attribute of ContourSet
>> objects that contains the (x,y) values for the contour?  Is there some
>> way to see that a ContourSet object has separate pieces?
>>
>> Any help would be appreciated.
>>
>> Thanks,
>> Jon
>>
>>
>>
>> --
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit.  See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] selecting part of a contour to plot

2010-06-22 Thread Benjamin Root
Jon,

One thing you can do is to manually specify the levels to contour for in the
contour call, or just specify the number of contours (and contour() will
figure out the levels for you).  The fourth argument to contour() allows you
to give a sequence of values (or an integer) for the isopleths.  So, if you
want just one line (but have it chosen automatically):

contour(x, y, z, 1)

If you want a contour to always be for the value of 4.5, for example, then:

contour(x, y, z, [4.5])

Should do the trick.

I hope that helps,
Ben Root



On Tue, Jun 22, 2010 at 1:46 PM, Jonathan Slavin wrote:

> To all:
>
> I'm making a plot with an image and a contour on it.  I use only one
> level in the call to contour, but it results in two distinct contours,
> an inner closed one and an outer open one.  I want to plot only the
> outer piece.  How might I go about that?  I've been looking at the
> properties of the ContourSet object returned by the call to contour but
> can't find anything useful yet.  Is there an attribute of ContourSet
> objects that contains the (x,y) values for the contour?  Is there some
> way to see that a ContourSet object has separate pieces?
>
> Any help would be appreciated.
>
> Thanks,
> Jon
>
>
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Setting the xaxis date ranges

2010-06-22 Thread Fa
Hi all,  I am trying to figure out how I can limit the xaxis date ranges.  I
tried set_xlim(), but that didn't work.  The graph consists of dates for the
xaxis and data for the yaxis.  Currently the xaxis is showing the entire
year's worth of months, even though there are no data for some months.  This
plot is really close to what I want, however, I need to limit the xaxis to a
only a few months.

  weeks= matplotlib.dates.WeekdayLocator()   # every year
  months   = matplotlib.dates.MonthLocator()  # every month
  monthsFmt = matplotlib.dates.DateFormatter('%b')
  fig = pylab.figure()
  ax = fig.add_subplot(111)
  ax.xaxis.set_major_locator(months)
  ax.xaxis.set_major_formatter(monthsFmt)
  ax.xaxis.set_minor_locator(weeks)
  pylab.bar(x,y)
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animated Line2D

2010-06-22 Thread Nie, Jinsuo
Super. I will need to study your solution tomorrow.

--
Jinsuo


-Original Message-
From: Stan West [mailto:stan.w...@nrl.navy.mil] 
Sent: Tuesday, June 22, 2010 4:41 PM
To: Nie, Jinsuo; matplotlib-users@lists.sourceforge.net
Subject: RE: [Matplotlib-users] Animated Line2D

> From: Nie, Jinsuo [mailto:j...@bnl.gov] 
> Sent: Tuesday, June 22, 2010 09:33
...
> I modified the path_editor.py example in order to make a line editor,
as
> attached. The path_editor.py worked fine on Qt4Agg.  However, in the
> line editor, the line was not draggable on the same backend.
...


The problem seems to stem from the line not being marked invalid when
its
set_data method is called.  This can be seen by modifying your
motion_notify_callback method as follows; I removed the previous print
statements and inserted a new one:

def motion_notify_callback(self, event):
'on mouse movement'
if not self.showverts: return
if self._ind is None: return
if event.inaxes is None: return
if event.button != 1: return
x,y = self.line.get_data()
x[self._ind] = event.xdata
y[self._ind] = event.ydata
self.line.set_data(x, y)
print self.line._invalid
self.canvas.restore_region(self.background)
self.ax.draw_artist(self.line)
self.canvas.blit(self.ax.bbox)

The x returned by get_data is the same object as line._xorig (a private
attribute of the line object), so the changes you make to elements of x
also
apply to _xorig.  Then, set_data compares the incoming x with _xorig,
sees
that they are the same object, and doesn't set the _invalid attribute to
True.
With _invalid still False, the line is not redrawn.

I tested on Windows 7 with matplotlib 0.99.1 (and saw the same behavior
you
did).  The relevant code in matplotlib's lines.py was changed in
revision 8054
(if I'm interpreting correctly), and that's why John saw the animation
using
more recent matplotlib code.  I checked the last released version
(0.99.3) and
found the same code for set_data as in 0.99.1, so updating to 0.99.3
won't
help.

However, I see two alternative easy solutions.  (1) After calling
self.line.set_data, call self.line.recache, which is what would happen
automatically if the _invalid attribute were True.  (2) Call set_data
with
different objects than the ones you received from get_data.  For
example:

vertices = zip(*self.line.get_data())
vertices[self._ind] = event.xdata, event.ydata
self.line.set_data(zip(*vertices))

The set_data method will then set _invalid to True, enabling the line to
be
redrawn.


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animated Line2D

2010-06-22 Thread Stan West
> From: Nie, Jinsuo [mailto:j...@bnl.gov] 
> Sent: Tuesday, June 22, 2010 09:33
...
> I modified the path_editor.py example in order to make a line editor, as
> attached. The path_editor.py worked fine on Qt4Agg.  However, in the
> line editor, the line was not draggable on the same backend.
...


The problem seems to stem from the line not being marked invalid when its
set_data method is called.  This can be seen by modifying your
motion_notify_callback method as follows; I removed the previous print
statements and inserted a new one:

def motion_notify_callback(self, event):
'on mouse movement'
if not self.showverts: return
if self._ind is None: return
if event.inaxes is None: return
if event.button != 1: return
x,y = self.line.get_data()
x[self._ind] = event.xdata
y[self._ind] = event.ydata
self.line.set_data(x, y)
print self.line._invalid
self.canvas.restore_region(self.background)
self.ax.draw_artist(self.line)
self.canvas.blit(self.ax.bbox)

The x returned by get_data is the same object as line._xorig (a private
attribute of the line object), so the changes you make to elements of x also
apply to _xorig.  Then, set_data compares the incoming x with _xorig, sees
that they are the same object, and doesn't set the _invalid attribute to True.
With _invalid still False, the line is not redrawn.

I tested on Windows 7 with matplotlib 0.99.1 (and saw the same behavior you
did).  The relevant code in matplotlib's lines.py was changed in revision 8054
(if I'm interpreting correctly), and that's why John saw the animation using
more recent matplotlib code.  I checked the last released version (0.99.3) and
found the same code for set_data as in 0.99.1, so updating to 0.99.3 won't
help.

However, I see two alternative easy solutions.  (1) After calling
self.line.set_data, call self.line.recache, which is what would happen
automatically if the _invalid attribute were True.  (2) Call set_data with
different objects than the ones you received from get_data.  For example:

vertices = zip(*self.line.get_data())
vertices[self._ind] = event.xdata, event.ydata
self.line.set_data(zip(*vertices))

The set_data method will then set _invalid to True, enabling the line to be
redrawn.


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] selecting part of a contour to plot

2010-06-22 Thread Jonathan Slavin
To all:

I'm making a plot with an image and a contour on it.  I use only one
level in the call to contour, but it results in two distinct contours,
an inner closed one and an outer open one.  I want to plot only the
outer piece.  How might I go about that?  I've been looking at the
properties of the ContourSet object returned by the call to contour but
can't find anything useful yet.  Is there an attribute of ContourSet
objects that contains the (x,y) values for the contour?  Is there some
way to see that a ContourSet object has separate pieces?

Any help would be appreciated.

Thanks,
Jon


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with RectangleSelector

2010-06-22 Thread Michael Droettboom

On 06/22/2010 11:39 AM, Benjamin Root wrote:



On Tue, Jun 22, 2010 at 3:45 AM, Matthias Michler 
mailto:matthiasmich...@gmx.net>> wrote:


On Tuesday, June 22, 2010 10:03:06 am Eric Firing wrote:
> On 06/21/2010 09:28 PM, Matthias Michler wrote:
> > On Monday, June 21, 2010 06:30:04 pm Eric Firing wrote:
> >> On 06/21/2010 06:10 AM, Matthias Michler wrote:
> >>> Hello list,
> >>>
> >>> I'm encountering a strange problem with the
RectangleSelector using the
> >>> latest version of svn. Namely it doesn't work if it wasn't
initialized
> >>> as RS = RectangleSelector(...)
> >>> but using
> >>> RectangleSelector(...)
> >>> in my script.
> >>>
> >>> I modified the example rectangle_selector.py from the folder
> >>> examples/widgets to illustrate my observation.
> >>>
> >>> Can anybody reproduce my findings or even explain what is
going on?
> >>
> >> If you don't keep a reference to the RectangleSelector object, it
> >> vanishes--it is garbage-collected.
> >>
> >> Eric
> >
> > Hi Eric,
> >
> > thanks for your reply. That sounds reasonable, but I'm still
confused.
> > With the matplotlib release 0.99.1.1 the RectangleSelector
works with
> > and without a reference to it. Was this old behavior somehow
unintended?

Hi Eric,

> I don't know.  In both cases, are you trying it in a script, and
running
> it outside ipython?  Ipython keeps references to inputs and outputs.

yes I'm just using

python rectangle_selector.py

with the slightly modified script I have sent last time for
matplotlib-svn and
additionally comment out the 'button' - keyword argument for the
release
0.99.1.1. The only difference between the two runs is whether
matplotlib-svn is
found in the PYTHONPATH or not.

> There haven't been many changes to widgets.py, and I don't see
anything
> that could account for the difference I also don't see what
could keep
> it alive if you don't keep a reference to it.
>
> If the same externally-run script works differently in this respect
> between the two mpl versions, then I'm baffled.

I'm baffled, too. That was what made starting this thread and hope
for an
explanation, what I'm doing wrong.

Kind regards,
Matthias


I could have sworn that there was a bug fix a month or two ago dealing 
with what appeared to be a memory leak of some sort.  It seemed that 
some stuff was not getting garbage-collected because they weren't 
completely dereferenced.  I seem to recall that it had something to do 
with various backend action callbacks not being dis-connected when 
finished (or the action was being connected too many times).


Maybe that might explain the difference in behavior (that is, that the 
old behavior was a "bug" not a "feature")?

Yes, precisely.

Mike

--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with RectangleSelector

2010-06-22 Thread Benjamin Root
On Tue, Jun 22, 2010 at 3:45 AM, Matthias Michler
wrote:

> On Tuesday, June 22, 2010 10:03:06 am Eric Firing wrote:
> > On 06/21/2010 09:28 PM, Matthias Michler wrote:
> > > On Monday, June 21, 2010 06:30:04 pm Eric Firing wrote:
> > >> On 06/21/2010 06:10 AM, Matthias Michler wrote:
> > >>> Hello list,
> > >>>
> > >>> I'm encountering a strange problem with the RectangleSelector using
> the
> > >>> latest version of svn. Namely it doesn't work if it wasn't
> initialized
> > >>> as RS = RectangleSelector(...)
> > >>> but using
> > >>> RectangleSelector(...)
> > >>> in my script.
> > >>>
> > >>> I modified the example rectangle_selector.py from the folder
> > >>> examples/widgets to illustrate my observation.
> > >>>
> > >>> Can anybody reproduce my findings or even explain what is going on?
> > >>
> > >> If you don't keep a reference to the RectangleSelector object, it
> > >> vanishes--it is garbage-collected.
> > >>
> > >> Eric
> > >
> > > Hi Eric,
> > >
> > > thanks for your reply. That sounds reasonable, but I'm still confused.
> > > With the matplotlib release 0.99.1.1 the RectangleSelector works with
> > > and without a reference to it. Was this old behavior somehow
> unintended?
>
> Hi Eric,
>
> > I don't know.  In both cases, are you trying it in a script, and running
> > it outside ipython?  Ipython keeps references to inputs and outputs.
>
> yes I'm just using
>
> python rectangle_selector.py
>
> with the slightly modified script I have sent last time for matplotlib-svn
> and
> additionally comment out the 'button' - keyword argument for the release
> 0.99.1.1. The only difference between the two runs is whether
> matplotlib-svn is
> found in the PYTHONPATH or not.
>
> > There haven't been many changes to widgets.py, and I don't see anything
> > that could account for the difference I also don't see what could keep
> > it alive if you don't keep a reference to it.
> >
> > If the same externally-run script works differently in this respect
> > between the two mpl versions, then I'm baffled.
>
> I'm baffled, too. That was what made starting this thread and hope for an
> explanation, what I'm doing wrong.
>
> Kind regards,
> Matthias
>
>
I could have sworn that there was a bug fix a month or two ago dealing with
what appeared to be a memory leak of some sort.  It seemed that some stuff
was not getting garbage-collected because they weren't completely
dereferenced.  I seem to recall that it had something to do with various
backend action callbacks not being dis-connected when finished (or the
action was being connected too many times).

Maybe that might explain the difference in behavior (that is, that the old
behavior was a "bug" not a "feature")?

Ben Root
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Animated Line2D

2010-06-22 Thread Nie, Jinsuo
I am reposting my problem since I have not been able to solve it myself.
I guess my original question has been buried deeply in this list.

I modified the path_editor.py example in order to make a line editor, as
attached. The path_editor.py worked fine on Qt4Agg.  However, in the
line editor, the line was not draggable on the same backend. The
printout showed that the line (nodal coordinates) had been updated but
it was not redrawn in the axes. I also tested the line editor on WXAgg
and TkAgg and it did not work either. I am using Windows 7.

John Hunter tested this line editor on his system and found it was
working properly.  I wonder whether this is a issue of backend/os.  I
would like invite people to simply run this script and report your
successfulness and your backend/os. It will be especially useful for me
if you are using Qt4Agg on Windows 7. 

Thank you very much.

--
Jinsuo




line_editor.py
Description: line_editor.py
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Demo does not work on Snow Leopard

2010-06-22 Thread Friedrich Romstedt
Many apologises for the slow response ...

I'm quite convinced the path is not an issue.

2010/6/19 Hana Sevcikova :
> I see there are some compatibility issues. What would be the best way to
> deal with it?

This should be the issue.  I think usually the matplotlib binaries are
linked against the same libraries as the Python binaries to avoid such
trouble, but for the 10.6 issue this went wrong somehow?  I don't
know.

A possibility would be to compile Python and matplotlib yourself.
This can, for matplotlib, be somewhat troublesome.  There is a
recommended way via the make.osx script, and "my" way via tweaking of
the config files.  The recommended way downloads freetype2 etc. into a
local directory and does afaik hard linking, "my" way links it the
usual dynamic way against system-wide installed libraries.  The
make.osx way is way from perfect, but it should work, albeit I
personally like the other way much more, since it appears much more
clean to me.  Tell me what you prefer.  If you prefer "my" way, I will
give you detailed instructions, with the make.osx way I'm neither
comfortable nor acquainted, maybe John can help you then.  There's
also a recent thread about building matplotlib on Mac (10.6 if I'm not
mistaken) with make.osx.

Friedrich

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with RectangleSelector

2010-06-22 Thread Matthias Michler
On Tuesday, June 22, 2010 10:03:06 am Eric Firing wrote:
> On 06/21/2010 09:28 PM, Matthias Michler wrote:
> > On Monday, June 21, 2010 06:30:04 pm Eric Firing wrote:
> >> On 06/21/2010 06:10 AM, Matthias Michler wrote:
> >>> Hello list,
> >>> 
> >>> I'm encountering a strange problem with the RectangleSelector using the
> >>> latest version of svn. Namely it doesn't work if it wasn't initialized
> >>> as RS = RectangleSelector(...)
> >>> but using
> >>> RectangleSelector(...)
> >>> in my script.
> >>> 
> >>> I modified the example rectangle_selector.py from the folder
> >>> examples/widgets to illustrate my observation.
> >>> 
> >>> Can anybody reproduce my findings or even explain what is going on?
> >> 
> >> If you don't keep a reference to the RectangleSelector object, it
> >> vanishes--it is garbage-collected.
> >> 
> >> Eric
> > 
> > Hi Eric,
> > 
> > thanks for your reply. That sounds reasonable, but I'm still confused.
> > With the matplotlib release 0.99.1.1 the RectangleSelector works with
> > and without a reference to it. Was this old behavior somehow unintended?

Hi Eric,

> I don't know.  In both cases, are you trying it in a script, and running
> it outside ipython?  Ipython keeps references to inputs and outputs.

yes I'm just using

python rectangle_selector.py 

with the slightly modified script I have sent last time for matplotlib-svn and 
additionally comment out the 'button' - keyword argument for the release 
0.99.1.1. The only difference between the two runs is whether matplotlib-svn is 
found in the PYTHONPATH or not.

> There haven't been many changes to widgets.py, and I don't see anything
> that could account for the difference I also don't see what could keep
> it alive if you don't keep a reference to it.
> 
> If the same externally-run script works differently in this respect
> between the two mpl versions, then I'm baffled.

I'm baffled, too. That was what made starting this thread and hope for an 
explanation, what I'm doing wrong.

Kind regards,
Matthias

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with RectangleSelector

2010-06-22 Thread Eric Firing
On 06/21/2010 09:28 PM, Matthias Michler wrote:
> On Monday, June 21, 2010 06:30:04 pm Eric Firing wrote:
>> On 06/21/2010 06:10 AM, Matthias Michler wrote:
>>> Hello list,
>>>
>>> I'm encountering a strange problem with the RectangleSelector using the
>>> latest version of svn. Namely it doesn't work if it wasn't initialized
>>> as RS = RectangleSelector(...)
>>> but using
>>> RectangleSelector(...)
>>> in my script.
>>>
>>> I modified the example rectangle_selector.py from the folder
>>> examples/widgets to illustrate my observation.
>>>
>>> Can anybody reproduce my findings or even explain what is going on?
>>
>> If you don't keep a reference to the RectangleSelector object, it
>> vanishes--it is garbage-collected.
>>
>> Eric
>
> Hi Eric,
>
> thanks for your reply. That sounds reasonable, but I'm still confused. With
> the matplotlib release 0.99.1.1 the RectangleSelector works with and without a
> reference to it. Was this old behavior somehow unintended?

I don't know.  In both cases, are you trying it in a script, and running 
it outside ipython?  Ipython keeps references to inputs and outputs.

There haven't been many changes to widgets.py, and I don't see anything 
that could account for the difference.  I also don't see what could keep 
it alive if you don't keep a reference to it.

If the same externally-run script works differently in this respect 
between the two mpl versions, then I'm baffled.

Eric

>
> Kind regards,
> Matthias
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with RectangleSelector

2010-06-22 Thread Matthias Michler
On Monday, June 21, 2010 06:30:04 pm Eric Firing wrote:
> On 06/21/2010 06:10 AM, Matthias Michler wrote:
> > Hello list,
> > 
> > I'm encountering a strange problem with the RectangleSelector using the
> > latest version of svn. Namely it doesn't work if it wasn't initialized
> > as RS = RectangleSelector(...)
> > but using
> > RectangleSelector(...)
> > in my script.
> > 
> > I modified the example rectangle_selector.py from the folder
> > examples/widgets to illustrate my observation.
> > 
> > Can anybody reproduce my findings or even explain what is going on?
> 
> If you don't keep a reference to the RectangleSelector object, it
> vanishes--it is garbage-collected.
> 
> Eric

Hi Eric,

thanks for your reply. That sounds reasonable, but I'm still confused. With 
the matplotlib release 0.99.1.1 the RectangleSelector works with and without a 
reference to it. Was this old behavior somehow unintended?

Kind regards,
Matthias

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users