|
From: Joaquin A. M. <gat...@ho...> - 2006-08-12 17:05:06
|
Dear all,
I upgraded matplotlib from 0.87.2.win32-py2.4 to 0.87.4. When trying to run
the test program
#program text.py
import matplotlib as mpl
mpl.use('WXAgg')
mpl.interactive(False)
from pylab import plot, show
plot([1,2,3,4])
show()
double clicking on it or at the command line I got a warning from python.exe
saying that library wxmsw26uh_vc.dll could not be found. This warning never
appeared with vs 87.2.
Surprisingly, after saying OK to the warning the plot is plotted.
I searched the web and found that recently someone reported a similar
problem with matplotlib 87.4 and this library to the enthon team. I searched
my hard disk and I found this library in the support directory of
wxGlade(!!!???). I put this library in the Python24 directory and the
warning disappeared but then I got a new one:
C:\>python text.py
Traceback (most recent call last):
File "text.py", line 6, in ?
show()
File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 1
193, in show
figwin.canvas.draw()
File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_wxagg.py",
lin
e 63, in draw
self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the
wx.Bitmap
I have the same problem with version 87.3. The problem only appears if I
want to use WXAgg.
I went back to vs87.2 and everything works as expected.
Could someone help me?
Thanks
Joaquin
_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en
MSN Motor. http://motor.msn.es/researchcentre/
|
|
From: Charlie M. <cw...@gm...> - 2006-08-12 18:07:52
|
Matplotlib didn't used to link against the wxpython c-api. The recent
versions are linked against the unicode version of wx, not the ansi.
You can install the unicode version. We are trying to decide how to
handle this.
- Charlie
On 8/12/06, Joaquin Abian Monux <gat...@ho...> wrote:
> Dear all,
> I upgraded matplotlib from 0.87.2.win32-py2.4 to 0.87.4. When trying to r=
un
> the test program
>
> #program text.py
> import matplotlib as mpl
> mpl.use('WXAgg')
> mpl.interactive(False)
> from pylab import plot, show
> plot([1,2,3,4])
> show()
>
> double clicking on it or at the command line I got a warning from python.=
exe
> saying that library wxmsw26uh_vc.dll could not be found. This warning nev=
er
> appeared with vs 87.2.
> Surprisingly, after saying OK to the warning the plot is plotted.
> I searched the web and found that recently someone reported a similar
> problem with matplotlib 87.4 and this library to the enthon team. I searc=
hed
> my hard disk and I found this library in the support directory of
> wxGlade(!!!???). I put this library in the Python24 directory and the
> warning disappeared but then I got a new one:
>
> C:\>python text.py
>
> Traceback (most recent call last):
> File "text.py", line 6, in ?
> show()
> File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_wx.py",
> line 1
> 193, in show
> figwin.canvas.draw()
> File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_wxagg.p=
y",
> lin
> e 63, in draw
> self.bitmap =3D _convert_agg_to_wx_bitmap(self.get_renderer(), None)
> MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the
> wx.Bitmap
>
> I have the same problem with version 87.3. The problem only appears if I
> want to use WXAgg.
> I went back to vs87.2 and everything works as expected.
>
> Could someone help me?
>
> Thanks
> Joaquin
>
> _________________________________________________________________
> =BFEst=E1s pensando en cambiar de coche? Todas los modelos de serie y ext=
ras en
> MSN Motor. http://motor.msn.es/researchcentre/
>
>
> -------------------------------------------------------------------------
> 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 ea=
sier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: John H. <jdh...@ac...> - 2006-08-12 18:33:32
|
>>>>> "Charlie" == Charlie Moad <cw...@gm...> writes:
Charlie> Matplotlib didn't used to link against the wxpython
Charlie> c-api. The recent versions are linked against the
Charlie> unicode version of wx, not the ansi. You can install the
Charlie> unicode version. We are trying to decide how to handle
Charlie> this.
On some backends, eg qt, we can do the blit via python method calls
and python buffer objects. I know this can be done w/ pygtk and it
has been on my wishlist to remove the gtk extension code and use pure
python since getting rid of gtk, wx and tk devel headers and libs at
build time would significantly reduce the kinds of cross-platform
build and runtime issues we are seeing from this GUI dependent
extension code.
Charlie, since you are pretty familiar with the blitting API, perhaps
you could take a look and see how much work it would be to do wx
blitting w/o extension code. I'd be happy to add some additional
helper methods in agg if need be, as we did for qt. I'd be willing to
trade a little performance to avoid these distribution headaches.
JDH
|
|
From: Christopher B. <Chr...@no...> - 2006-08-14 18:12:38
|
John Hunter wrote:
> Charlie, since you are pretty familiar with the blitting API, perhaps
> you could take a look and see how much work it would be to do wx
> blitting w/o extension code. I'd be happy to add some additional
> helper methods in agg if need be, as we did for qt.
Didn't MPL originally use the Python API, but with less than stellar
performance? I'm not sure how efficient we can get without making
changes to wx. However, I think Robin Dunn is pretty open to making some
of those changes.
For one, he told me a while back that he was going to try to expose some
of the API for working directly with wxBitmaps. If we could dump data
straight into a wxBitmap, that would be the best option. That's likely
to be tricky, however, as a wxBitmap is a wrapper around whatever the
platform-native format is for a Bitmap. However, while there are a lot
of possible formats for native Bitmaps, 24bit RGB is pretty darn common,
if we could get top performance from that from that format, we'd be a
long way in the right direction.
Another (or additional) option is for both MPL and wx to support the new
array interface protocol in numpy. There's a lot of other reasons to do
that, and, again, Robin has expressed his support for this. If we could
get MPL, wx, numpy, and PIL all passing data around with this protocol,
we'd be in great shape. Travis posted a patch to PIL for support a while
back, I don't know if it's going to get applied or not, but it's worth
looking at.
Another place to look for idea is Enthought's Kiva -- It's Agg back-end
interacts well with wx -- or so I've heard. I haven't tried it yet myself.
I'm no C++ wiz, but I'd be willing to help with the wx modifications --
it's been on my list for a while. Should I send a note to Robin Dunn for
ideas?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Stefan v. d. W. <st...@su...> - 2006-08-14 23:24:29
|
On Mon, Aug 14, 2006 at 11:12:29AM -0700, Christopher Barker wrote: > Another (or additional) option is for both MPL and wx to support the ne= w=20 > array interface protocol in numpy. There's a lot of other reasons to do= =20 > that, and, again, Robin has expressed his support for this. If we could= =20 > get MPL, wx, numpy, and PIL all passing data around with this protocol,= =20 > we'd be in great shape. Travis posted a patch to PIL for support a whil= e=20 > back, I don't know if it's going to get applied or not, but it's worth=20 > looking at. Looks like it has been added already. From http://effbot.org/zone/pil-changes-116.htm - Added "fromarray" function, which takes an object implementing the NumPy array interface and creates a PIL Image from it. (from Travis Oliphant). - Added NumPy array interface support (__array_interface__) to the Image class (based on code by Travis Oliphant). This allows you to easily convert between PIL image memories and NumPy arrays: import numpy, Image i =3D Image.open('lena.jpg') a =3D numpy.asarray(i) # a is readonly i =3D Image.fromarray(a) Regards St=E9fan |