[matplotlib-devel] wx.AlphaPixelData() is failing on windows server 2003

2010-03-10 Thread MOhanKumar

wx.AlphaPixelData() is failing on windows server 2003. The sample code is
given below.
The same is working fine on windows xp. what could be the reason?

import wx

class Size(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(250, 200))
absFilename =
"C:\Python26\Lib\site-packages\win32\Demos\images\smiley.bmp"
bmp = wx.Bitmap(absFilename, wx.BITMAP_TYPE_BMP)
pixelData = wx.AlphaPixelData(bmp)

if not pixelData:
print "error"
else:
print "fine"



app = wx.App(False)
Size(None, -1, 'Test')
app.MainLoop()

-- 
View this message in context: 
http://old.nabble.com/wx.AlphaPixelData%28%29-is-failing-on-windows-server-2003-tp27847892p27847892.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] wx.AlphaPixelData() is failing on windows server 2003

2010-03-10 Thread Michael Droettboom
Is this bug related to matplotlib?  (i.e. does it happen only when 
matplotlib is imported?)  If not, you may have more luck on the wxpython 
mailing list.

Mike

MOhanKumar wrote:
> wx.AlphaPixelData() is failing on windows server 2003. The sample code is
> given below.
> The same is working fine on windows xp. what could be the reason?
>
> import wx
>
> class Size(wx.Frame):
> def __init__(self, parent, id, title):
> wx.Frame.__init__(self, parent, id, title, size=(250, 200))
> absFilename =
> "C:\Python26\Lib\site-packages\win32\Demos\images\smiley.bmp"
> bmp = wx.Bitmap(absFilename, wx.BITMAP_TYPE_BMP)
> pixelData = wx.AlphaPixelData(bmp)
>
> if not pixelData:
> print "error"
> else:
> print "fine"
>
>
>
> app = wx.App(False)
> Size(None, -1, 'Test')
> app.MainLoop()
>
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] wx.AlphaPixelData() is failing on windows server 2003

2010-03-10 Thread Chris Barker
Michael Droettboom wrote:
> Is this bug related to matplotlib?  (i.e. does it happen only when 
> matplotlib is imported?)

It looks like you've done a pure-wx test, so it is a wx issue.

>  If not, you may have more luck on the wxpython 
> mailing list.

yup, that's the place for it -- I suspect that windows server 2003 is 
old enough that it may not have the newer alpha-supporting drawing stuff 
-- that may be a dll that you could add, though.

You'll get a better answer on the wxpython-users list.

-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

chris.bar...@noaa.gov

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Inconsistent behavior in plt.hist

2010-03-10 Thread Tony S Yu
I get inconsistent behavior when plotting multiple sets of data with plt.hist. 
Here's a quick example:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> x = np.random.randn(10)
>>> y = np.random.randn(9)
>>> plt.hist([x, y])

The above code plots two sets of histograms, as expected. My data sets have 
different lengths, but by coincidence, I had two data sets with the same 
length. When you call hist on data sets with the same length

>>> plt.hist([x[:-1], y])

then hist actually transposes the data; for the above, you get 9 sets of data 
instead of two.

Below is a patch that fixes the issue, but unfortunately, it'll probably break 
other peoples' code; in fact, it breaks the example code 
(histogram_demo_extended.py). I'm not sure what's worse: dealing with the 
inconsistency or breaking a lot of code. But if there's a time to break code, 
MPL 1.0 might be it :)

Best,
-Tony


Index: lib/matplotlib/axes.py
===
--- lib/matplotlib/axes.py  (revision 8187)
+++ lib/matplotlib/axes.py  (working copy)
@@ -7122,7 +7122,7 @@
 
 try:
 # make sure a copy is created: don't use asarray
-x = np.transpose(np.array(x))
+x = np.array(x)
 if len(x.shape)==1:
 x.shape = (1,x.shape[0])
 elif len(x.shape)==2 and x.shape[1]http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel