[matplotlib-devel] problems with labeling contour lines in 0.98.3

2008-08-19 Thread Mark Bakker
Hello David and the developers list-

I have had little luck on the mailing list, so sorry for writing you
directly (David may be on vacation).

I have two problems labeling contour lines in 0.98.3.

First, when I call clabel, it removes all contours that are not labeled
(because the label doesn't fit on the section of contour, I presume).
This seems like a bug to me (or a really odd feature). It doesn't do this
when inline = False, but I don't think it should do it either when inline =
True
Easy example:

>>> x,y = meshgrid( linspace(-10,10,50), linspace(-10,10,50) )
>>> z = log(x**2 + y**2)
>>> cobj = contour(x,y,z) # Note that there are 8 contours levels (11
contour sections in all)
>>> cobj.clabel()

>>> draw()  # Now only 5 contours are drawn; the ones in the middle are
removed.

Second, when using the new manual labeling of contour labels (which is
pretty neat!), how do I end this feature?
The doc string says: right click, or potentially click both mouse buttons
together (which already worries me).
Neither works for me on win32, mpl 0.98.3, TkAgg backend, interactive mode.
Does anybody have a solution?

Thanks, Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Bugs in Qt4 backend with the latest PyQt release

2008-08-19 Thread Pierre Raybaut
Hi Darren,

2008/8/18 Darren Dale <[EMAIL PROTECTED]>:
> Nevermind. It turns out its not exactly poor performance, but for some reason
> the gui events were not getting processed as frequently on windows. Maybe Qt
> changed something in an attempt to optimize performance.
>
> I applied a patch in svn 6043, but its a really simple fix. At the end of
> backend_qt4agg.FigureCanvasQTAgg.draw, after self.update(), add this line:
>
>QtGui.qApp.processEvents()
>
> It seemed to improve things on my windows laptop,  but let me know if it fixes
> the problem for you.

Good work Darren, thanks, it works perfectly!
That is great news because I found (and reported) this bug three
months ago, so I was beginning to worry about the future of Qt4
backend.
Now I can consider updating PyQt in Python(x,y).

> I forgot to mention, the svg icons display fine for me with windows xp,
> matplotlib-0.98.

Forget about it, I've just found out that this is related to one of my
own-made packages.

Thanks
Pierre

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] imshow zorder

2008-08-19 Thread Grégory Lielens
On Tue, 2007-11-20 at 11:15 -1000, Eric Firing wrote:
> Jeff Whitaker wrote:
> > If I draw two images with imshow, then set_zorder for one of them to be 
> > higher than the other, should that one be the one that displays?
> 
> Jeff,
> 
> It is a wart.  Images are handled separately from other artists, and 
> always drawn first, either as a composite or in the order in which they 
> were added to the list.  Here is the relevant code in the Axes.draw() 
> method:
> 
>  if len(self.images)<=1 or renderer.option_image_nocomposite():
>  for im in self.images:
>  im.draw(renderer)
>  else:
>  # make a composite image blending alpha
>  # list of (mimage.Image, ox, oy)
> 
> 
>  mag = renderer.get_image_magnification()
>  ims = [(im.make_image(mag),0,0)
> for im in self.images if im.get_visible()]
> 
> 
>  im = mimage.from_images(self.bbox.height()*mag,
>  self.bbox.width()*mag,
>  ims)
>  im.is_grayscale = False
>  l, b, w, h = self.bbox.get_bounds()
>  # composite images need special args so they will not
>  # respect z-order for now
>  renderer.draw_image(l, b, im, self.bbox)
> 
> Maybe the set_zorder method for images should raise a warning, since it 
>   can't do what one might reasonably expect.
> 
> Mike may be able to comment on the prospects for removing this wart at 
> some point in the transforms branch; he is looking at related questions 
> right now.
> 
> Eric
> 
> > 
> > for example,  with
> > 
> > from pylab import *
> > delta = 0.025
> > x = y = arange(-3.0, 3.0, delta)
> > X, Y = meshgrid(x, y)
> > Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> > Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> > Z = Z2-Z1  # difference of Gaussians
> > im2 = imshow(Z2, interpolation='bilinear', cmap=cm.gray,
> > origin='lower', extent=[-3,3,-3,3])
> > im2.set_zorder(2)
> > im1 = imshow(Z1, interpolation='bilinear', cmap=cm.gray,
> > origin='lower', extent=[-3,3,-3,3])
> > im1.set_zorder(1)
> > show()
> > 
> > I expected Z2 to be plotted, but I actually see Z1.  In fact, I always 
> > see the last one that was plotted, regardless of what I set the zorder to.
> > 
> > I'm using the latest SVN, with GTKAgg.
> > 
> > -Jeff
> > 

Any idea if the "wart" can be removed? I tried to use zorder with the
SVN matplotlib (in conjuction with alpha-transparency, it can give a
great way to represent missing data in waterfall diagram)
but without success, image is still always in the back
I did not use imshow, but NonUniformImage, but I guess the problem is
the same for all AxisImage instances...

BTW, I also submitted a patch to NonUniformImage to allows for bilinear
interpolation on rectangular non-uniform grids. I think the original
code was yours, so maybe you have something to say about the patch ;-)


Best regards,

Greg.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] plotting markers fails with current svn

2008-08-19 Thread Michael Droettboom
Thanks for catching this.  Looks like the correct solution to the error I 
introduced.

Cheers,
Mike

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel