Darren Dale | 7 Mar 22:58
Picon
Favicon

question about transforms

I am having some trouble with the Cursor widget with the qt4agg backend. Here 
is a short script which works with the gtkagg backend with useblit either 
true or false:

----------
from matplotlib import rcParams
rcParams['backend']='gtkagg'
from pylab import *
from matplotlib.widgets import Cursor

t = arange(0.0, 1.0, 0.01)
s = sin(2*2*pi*t)
ax = subplot(111)

cursor = Cursor(ax, useblit=True)

ax.plot(t, s, 'o')
axis([0,1,-1,1])
show()
------------

If I use the qt4agg backend, with useblit False, the cursor lines do not 
render. If useblit is True, the lines render but the pixmap inside the axes 
is sheared. I've been looking at the backend_qt4agg code, the widgets.Cursor 
code, and the working animation_blit_qt4 example, but I'm stuck. Does anyone 
have any ideas?

Thanks,
Darren

(Continue reading)

Darren Dale | 8 Mar 17:36
Picon
Favicon

Re: question about transforms

On Friday 07 March 2008 4:58:03 pm Darren Dale wrote:
> I am having some trouble with the Cursor widget with the qt4agg backend.
> Here is a short script which works with the gtkagg backend with useblit
> either true or false:
>
> ----------
> from matplotlib import rcParams
> rcParams['backend']='gtkagg'
> from pylab import *
> from matplotlib.widgets import Cursor
>
> t = arange(0.0, 1.0, 0.01)
> s = sin(2*2*pi*t)
> ax = subplot(111)
>
> cursor = Cursor(ax, useblit=True)
>
> ax.plot(t, s, 'o')
> axis([0,1,-1,1])
> show()
> ------------
>
> If I use the qt4agg backend, with useblit False, the cursor lines do not
> render. If useblit is True, the lines render but the pixmap inside the axes
> is sheared. I've been looking at the backend_qt4agg code, the
> widgets.Cursor code, and the working animation_blit_qt4 example, but I'm
> stuck. Does anyone have any ideas?

Here is an additional wrinkle, sometimes the pixmap is sheared, and sometimes 
it is not. The behavior seems to shift back and forth when I change the 
(Continue reading)

Darren Dale | 8 Mar 19:06
Picon
Favicon

Re: question about buffer and bbox widths, bug identified

On Saturday 08 March 2008 11:36:45 am Darren Dale wrote:
> On Friday 07 March 2008 4:58:03 pm Darren Dale wrote:
> > I am having some trouble with the Cursor widget with the qt4agg backend.
> > Here is a short script which works with the gtkagg backend with useblit
> > either true or false:
> >
> > ----------
> > from matplotlib import rcParams
> > rcParams['backend']='gtkagg'
> > from pylab import *
> > from matplotlib.widgets import Cursor
> >
> > t = arange(0.0, 1.0, 0.01)
> > s = sin(2*2*pi*t)
> > ax = subplot(111)
> >
> > cursor = Cursor(ax, useblit=True)
> >
> > ax.plot(t, s, 'o')
> > axis([0,1,-1,1])
> > show()
> > ------------
> >
> > If I use the qt4agg backend, with useblit False, the cursor lines do not
> > render. If useblit is True, the lines render but the pixmap inside the
> > axes is sheared. I've been looking at the backend_qt4agg code, the
> > widgets.Cursor code, and the working animation_blit_qt4 example, but I'm
> > stuck. Does anyone have any ideas?
>
> Here is an additional wrinkle, sometimes the pixmap is sheared, and
(Continue reading)

Ted Drain | 10 Mar 05:21
Picon
Picon
Favicon

Using date axis messes up Line2D data?

I've got an MPL widget embedded in a qt application.  The user interacts w/
the GUI and causes data to be shown or hidden in the plot.  Since the data
can be very large (5-10 lines w/ 40,000 points in each), I've written code
that reads the data and builds Line2D objects.  Then I call axes.add_line()
and line.remove() to add and remove them from my plot.

This works fine when the x axis is a floating point axis.  If I switch the x
axis to dates, then when I try to re-add some removed lines, I get the error
at the bottom of the email.  A script that duplicates this is attached
(though I think you need to have an interactive mode session running to
really see what happens.  

As an example:

1) read data and build 4 Line2D objects
2) user shows lines 1 and 2 
3) user hides lines 1 and 2, shows lines 3 and 4
4) user hides lines 3 and 4, shows lines 1 and 2

These steps work fine w/ floats.  But if I tell the xaxis to be date
(axis.xaxis_date()), then step 4 above will give the error:

  File "./error.py", line 62, in <module>
    run( True )
  File "./error.py", line 53, in run
    ax.autoscale_view()
  File
"/group/monte/development/rh8/tools.2007_03_13/lib/python2.5/site-packages/m
atplotlib/axes.py", line 1268, in autoscale_view
    XL = self.xaxis.get_major_locator().autoscale()
(Continue reading)

Michael Droettboom | 10 Mar 13:22

Re: question about transforms

With the qt4agg backend, I also get no cursor with "useblit=False", but 
when "useblit=True" it seems to work just fine -- I don't see any 
shearing.  By shearing I assume you mean the image is warped like a 
parallelogram?  Or do mean tearing, in that it isn't updating fast 
enough?  (FWIW, I don't see either).

What versions of Qt do you have?  I've got:

                    Qt: Qt: 3.3.3, PyQt: 3.17.2
                   Qt4: Qt: 4.3.0, PyQt4: 4.2

Cheers,
Mike

Darren Dale wrote:
> I am having some trouble with the Cursor widget with the qt4agg backend. Here 
> is a short script which works with the gtkagg backend with useblit either 
> true or false:
>
> ----------
> from matplotlib import rcParams
> rcParams['backend']='gtkagg'
> from pylab import *
> from matplotlib.widgets import Cursor
>
> t = arange(0.0, 1.0, 0.01)
> s = sin(2*2*pi*t)
> ax = subplot(111)
>
> cursor = Cursor(ax, useblit=True)
(Continue reading)

Michael Droettboom | 10 Mar 13:24

Re: question about transforms

Sorry, I didn't see this latest e-mail before I replied before.  I see 
the shearing now that I've adjusted window size.  Maybe it could be 
related to the fact that width != span?  Anyway, I'll investigated 
further and get back.

Cheers,
Mike

Darren Dale wrote:
> On Friday 07 March 2008 4:58:03 pm Darren Dale wrote:
>   
>> I am having some trouble with the Cursor widget with the qt4agg backend.
>> Here is a short script which works with the gtkagg backend with useblit
>> either true or false:
>>
>> ----------
>> from matplotlib import rcParams
>> rcParams['backend']='gtkagg'
>> from pylab import *
>> from matplotlib.widgets import Cursor
>>
>> t = arange(0.0, 1.0, 0.01)
>> s = sin(2*2*pi*t)
>> ax = subplot(111)
>>
>> cursor = Cursor(ax, useblit=True)
>>
>> ax.plot(t, s, 'o')
>> axis([0,1,-1,1])
>> show()
(Continue reading)

Darren Dale | 10 Mar 13:26
Picon
Favicon

unable to commit to svn

Sourceforge is rejecting my commits, as if my username or password were 
incorrect. Is anyone else able to commit to svn?

Darren

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Michael Droettboom | 10 Mar 13:46

Re: question about transforms

No, I didn't see this message, but I think we arrived at the same 
conclusion.  I think the solution is just to calculate the width and 
height in the same way in both places (copy_to_bbox and the Qt blitting 
code in Python).  We can't change bbox.bounds, since many other parts of 
the code rely on that calculation being in pure floating point.  But 
there's only two places (in Qt and Qt4) that rely on the rounding 
behavior of copy_to_bbox, and IMHO, the way it does the rounding is the 
sanest way given that the edges must be integer-aligned.

I've committed these changes in r4995.

Cheers,
Mike

Darren Dale wrote:
> Hi Mike,
>
> On Monday 10 March 2008 08:24:27 am you wrote:
>   
>> Sorry, I didn't see this latest e-mail before I replied before.  I see
>> the shearing now that I've adjusted window size.  Maybe it could be
>> related to the fact that width != span?  Anyway, I'll investigated
>> further and get back.
>>     
>
> Thanks for having a look. But before you dig to deep, did you see my last post 
> to this thread?:
>
> -----
> I think this problem is due to a loss of precision in _backend_agg's 
(Continue reading)

Darren Dale | 10 Mar 13:50
Picon
Favicon

Re: question about transforms

That sounds fine to me. I just wanted to make sure that I wasn't glossing over 
a bug that could turn up elsewhere.

Thanks,
Darren

On Monday 10 March 2008 08:46:36 am Michael Droettboom wrote:
> No, I didn't see this message, but I think we arrived at the same
> conclusion.  I think the solution is just to calculate the width and
> height in the same way in both places (copy_to_bbox and the Qt blitting
> code in Python).  We can't change bbox.bounds, since many other parts of
> the code rely on that calculation being in pure floating point.  But
> there's only two places (in Qt and Qt4) that rely on the rounding
> behavior of copy_to_bbox, and IMHO, the way it does the rounding is the
> sanest way given that the edges must be integer-aligned.
>
> I've committed these changes in r4995.
>
> Cheers,
> Mike
>
> Darren Dale wrote:
> > Hi Mike,
> >
> > On Monday 10 March 2008 08:24:27 am you wrote:
> >> Sorry, I didn't see this latest e-mail before I replied before.  I see
> >> the shearing now that I've adjusted window size.  Maybe it could be
> >> related to the fact that width != span?  Anyway, I'll investigated
> >> further and get back.
> >
(Continue reading)

Michael Droettboom | 10 Mar 14:08

Re: unable to commit to svn

I just saw this today myself.  Apparently my password has "expired" 
(first time in years I've seen that happen).

I logged in to the sf.net web interface, it asked for my old and new 
passwords, and then I was able to use the new password with SVN.

Maybe this is a new policy?

Mike

Darren Dale wrote:
> Sourceforge is rejecting my commits, as if my username or password were 
> incorrect. Is anyone else able to commit to svn?
>
> Darren
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>   

--

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
(Continue reading)


Gmane