Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Darren Dale
On Wednesday 07 February 2007 12:09:18 pm Rob Hetland wrote:
> The MPL Qt backend requires PyQt (or, better, Qt4 and PyQt4).  PyQt
> does compile against the Qt Library, and also takes quite a while to
> complete.  PyQt does not use setuptools, and I am not sure how to
> make a generally usable binary distribution from it.
>
> I would say that installation is quite easy (although time consuming)
> -- perhaps just a good set of directions on the MPL site?
>
> -Rob
>
> On Feb 7, 2007, at 10:01 AM, Christopher Barker wrote:
> > Thanks for doing this Rob, its nice to get as much support on OS-X as
> > possible.
> >
> > Does the QT back-end need to be compiled against QT? or is it
> > python-only?

The Qt backend is pure python. 

Darren

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Rob Hetland

The MPL Qt backend requires PyQt (or, better, Qt4 and PyQt4).  PyQt  
does compile against the Qt Library, and also takes quite a while to  
complete.  PyQt does not use setuptools, and I am not sure how to  
make a generally usable binary distribution from it.

I would say that installation is quite easy (although time consuming)  
-- perhaps just a good set of directions on the MPL site?

-Rob

On Feb 7, 2007, at 10:01 AM, Christopher Barker wrote:

> Thanks for doing this Rob, its nice to get as much support on OS-X as
> possible.
>
> Does the QT back-end need to be compiled against QT? or is it  
> python-only?
>
>> QT4 takes *forever* to compile, but it seems to compile easier now
>> than previous versions that needed a small library hack.  The default
>> configuration compiles and installs fine.  The other tools (PyQt4 and
>> SIP) also compile and install painlessly with the default  
>> configuration.
>
> Any chance you could package it up an submit it to the pythonmac  
> archive?
>
> Does it support a Universal build?
>
> -Chris
>
>
> -- 
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
>
> -- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-07 Thread Christopher Barker
Werner F. Bruhin wrote:
> Great to see a new release, will put some time aside to test it with 
> wxPython early next week.

looking forward to your reports.

> which versions of wxPython are supported?

I haven't tried the new one, but the last release worked well with 
wxPython2.6.3, but had some issues with 2.8.* -- I don't think anyone 
has addressed those yet.

> Well, we haven't built any binaries yet.  We pushed a source release
> fast to try to get it into Feisty.  Sorry Chris!

well, I've been chattering on about this for awhile, but haven't 
contributed anything yet...

 > With wx2.8 out now
> and this being a major release, we definitely need to rethink wx
> builds.  We stuck with unicode for 0.87 to avoid confusion.  I would
> be happy to hear what wx users think/want.

I think it's time to just all unicode, all the way, but I mostly deal 
with English anyway.

> For me the ideal would be not to be depended on a particular release of 
> wxPython - big surprise no :-)

That would be nice.

> If I understand it correctly the dependency came in for performance 
> optimization, does 2.8 change something for this.

Perhaps. 2.8 has methods for directly setting the data in wxBitmaps. 
Before that, you needed to create a wxImage, then convert that to a bitmap.

However, to do that right, you'd need to be able to get the Agg bitmap 
as a Python buffer object that is in the binary form required by the 
platform. I think the majors need RGB and/or RGBA, but I'm not totally 
sure about that (maybe OS-X is ARGB?)

> - If yes, I would not see a problem with 0.9 requiring as a minimum 
> 2.8.0.1 but going forward I could use any 2.8.x or newer release.

That would be a good way to go, or have fallback on the older methods 
for less than 2.8 -- so instead of saying "you need 2.8 to use the wx 
backend" we can say: "you'll get better performance with wx if you use > 
2.8"

> - If no, then I guess we have to live with having a "fixed" dependency, 
> e.g. 0.87 is wxPython 2.6.x, 0.90 is wxPython 2.8.x, but it should 
> through at least a warning if one tries to use it with another wxPython 
> release.

Yes, it should. I've also started a patch for the build system that 
tries harder to make sure that you are building against the same wx that 
you are running -- that will at least help people built it themselves 
more easily.

NOTE: I took a look at the wx backend code a while ago, and it looks 
like even without the new Bitmap handlers in 2.8, it could be faster 
with straight Python code. Key is that a wxImage can be created from a 
Python buffer object without copying the data. So if we can expose the 
Agg buffer as a Python buffer, as RGB, then we should be able to get 
decent performance with pure python. You'd still need to do the 
wxBitmapFromImage thing, but the accelerated back-end does that too.

Look for a thread on this list a while back, with my and Ken's name on it.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Christopher Barker
Thanks for doing this Rob, its nice to get as much support on OS-X as 
possible.

Does the QT back-end need to be compiled against QT? or is it python-only?

> QT4 takes *forever* to compile, but it seems to compile easier now  
> than previous versions that needed a small library hack.  The default  
> configuration compiles and installs fine.  The other tools (PyQt4 and  
> SIP) also compile and install painlessly with the default configuration.

Any chance you could package it up an submit it to the pythonmac archive?

Does it support a Universal build?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Darren Dale
On Wednesday 07 February 2007 10:12:36 am Rob Hetland wrote:
> The patch works.  Thanks.  Two more things:
>
> 1 - the icons look very small in the toolbar buttons (they look
> bigger in TkAgg).  Is there a fix for this?

I'm not sure. I'll look into it when I get a chance.

> 2 - the subplot configure toolbar (where you get a pop-up window that
> lets you modify the axis size and position) does not work.  In
> particular, the sliders do not appear, although everything else seems
> to work (clicking in the empty window does modify the axis)

This is a known bug. We looked into it a while back, and couldn't make any 
headway.

Darren

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Rob Hetland

The patch works.  Thanks.  Two more things:

1 - the icons look very small in the toolbar buttons (they look  
bigger in TkAgg).  Is there a fix for this?

2 - the subplot configure toolbar (where you get a pop-up window that  
lets you modify the axis size and position) does not work.  In  
particular, the sliders do not appear, although everything else seems  
to work (clicking in the empty window does modify the axis)

These two fixes are beyond my skill set, but I'll help where I can..

-r

On Feb 7, 2007, at 8:58 AM, Darren Dale wrote:

> Hi Rob,
>
> On Wednesday 07 February 2007 09:06:42 am Rob Hetland wrote:
>> Developers:  Finally, I had to make some small changes to the qt4
>> backend so that things worked right.  One is an essential change --
>> the latin1() method no longer exists in the newer qt.  The other is a
>> cosmetic change so that I can see the cursor position in the toolbar
>> better.  Diff below.
>
> Thanks for the notes, and for the patch. I moved the margin  
> adjustment you
> suggested into a class attribute of NavigationToolbar2QT. This way,
> FigureManagerQT can get that information, which is needed to  
> properly set the
> height of the figure window. (figsize=(6,4) should yield a 6"x4"  
> plotting
> area, the height of the entire window is larger than 4" to  
> accommodate the
> toolbar.) Changes in svn 3004.
>
> Darren


Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Darren Dale
Hi Rob,

On Wednesday 07 February 2007 09:06:42 am Rob Hetland wrote:
> Developers:  Finally, I had to make some small changes to the qt4
> backend so that things worked right.  One is an essential change --
> the latin1() method no longer exists in the newer qt.  The other is a
> cosmetic change so that I can see the cursor position in the toolbar
> better.  Diff below.

Thanks for the notes, and for the patch. I moved the margin adjustment you 
suggested into a class attribute of NavigationToolbar2QT. This way, 
FigureManagerQT can get that information, which is needed to properly set the 
height of the figure window. (figsize=(6,4) should yield a 6"x4" plotting 
area, the height of the entire window is larger than 4" to accommodate the 
toolbar.) Changes in svn 3004.

Darren

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Rob Hetland

Here are some notes I made -- I hope it might save someone a bit of  
time.

So, I finally tried out a few other backends on mac os x.  I had been  
recommending and using TkAgg, as this works out of the box on mac os  
x.  However, it seems unsnappy sometimes, and there was this strange  
issue with the first window not giving control back to the command line.

QT4 takes *forever* to compile, but it seems to compile easier now  
than previous versions that needed a small library hack.  The default  
configuration compiles and installs fine.  The other tools (PyQt4 and  
SIP) also compile and install painlessly with the default configuration.

I initially forgot to set the -q4thread for ipython (since the other - 
pylab flag is hidden in a launching script).  After that it worked  
mostly fine.

I found that the correct  threading was sensitive to how I started  
ipython.  I have been using terminal, and I was starting ipython like  
this:

bash -l -c /path/to/ipython -q4thread

from within a terminal .term file (i.e., the terminal starts running  
ipython automatically).  This seems to not work great.  However, when  
I put this command in a script, and run the script like

bash -l -c pylab_start_script

thinks work as expected.  This is also true when just typing these  
commands in on the command line.   I almost always start ipython from  
a terminal .term file from quicksilver.  This gives me a dedicated  
(color coded) ipython window instantly that does not take away my  
shell.  This is all pretty slick, and I am pleased with the setup now.

Developers:  Finally, I had to make some small changes to the qt4  
backend so that things worked right.  One is an essential change --  
the latin1() method no longer exists in the newer qt.  The other is a  
cosmetic change so that I can see the cursor position in the toolbar  
better.  Diff below.

-Rob



Index: backend_qt4.py
===
--- backend_qt4.py  (revision 2999)
+++ backend_qt4.py  (working copy)
@@ -148,7 +148,7 @@
  def _get_key( self, event ):
  if event.key() < 256:
-key = event.text().latin1()
+key = str(event.text())
  elif self.keyvald.has_key( event.key() ):
  key = self.keyvald[ event.key() ]
  else:
@@ -290,7 +290,7 @@
  # The automatic layout doesn't look that good - it's  
too close
  # to the images so add a margin around it.
-margin = 4
+margin = 12
  button.setFixedSize( image.width()+margin, image.height 
()+margin )
  QtCore.QObject.connect( button, QtCore.SIGNAL( 'clicked 
()' ),
@@ -301,7 +301,7 @@
  # The stretch factor is 1 which means any resizing of the  
toolbar
  # will resize this label instead of the buttons.
  self.locLabel = QtGui.QLabel( "", self )
-self.locLabel.setAlignment( QtCore.Qt.AlignRight |  
QtCore.Qt.AlignVCenter )
+self.locLabel.setAlignment( QtCore.Qt.AlignRight |  
QtCore.Qt.AlignTop )
  self.locLabel.setSizePolicy(QtGui.QSizePolicy 
(QtGui.QSizePolicy.Ignored,
 
QtGui.QSizePolicy.Ignored))
  self.layout.addWidget( self.locLabel, 1 )



Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel