[Matplotlib-users] problems importing matplotlib in macos

2011-12-27 Thread sigma.z.1980

hi everyone, I run python 2.7.2. in Eclipse (recently upgraded from 2.6). I
have a problem with installing matplotlib (I found the version for python
2.7. MacOs 10.3, no later versions). If I run python in terminal using arch
-i386 python, and then 

from matplotlib.pylab import *

and similar stuff, everything works fine. If I run python in eclipse or just
without arch -i386, I can import matplotlib as 

from matplotlib import  *

but actually nothing gets imported. If I do it in the same way as above, I
get the message

no matching architecture in universal wrapper

which means there's conflict of versions or something like that. I tried
reinstalling the interpreter and adding matplotlib to forced built-ins, but
nothing helped. For some reason I didn't have this problem with numpy and
tkinter. 

Any suggestions are appreciated. 
-- 
View this message in context: 
http://old.nabble.com/problems-importing-matplotlib-in-macos-tp33037227p33037227.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contourf with rgba colours

2011-12-27 Thread Jeff Whitaker
On 12/27/11 12:07 PM, Logi Ragnarsson wrote:
 Hello,

 Is it supposed to be possible to do a filled contour plot with alpha 
 levels in the colour map? I'm plotting weather data on top of maps and 
 would very much like to plot low levels of wind and precipitation as 
 mostly transparent, with higher levels more opaque.

 If I replace the meat of the plotting code with these two lines:

   basemap.bluemarble()
   basemap.contourf(x, y, precipitation, 
 colors=colorConverter.to_rgba_array([
   # no colour for zero - fully transparent
   (1,0,0,0.5),
   (0,1,0,1),
   (0,1,1,0.5),
   (0,0,1,1),
   (1,0,1,0.5)
   ]), levels=[
   # no level for zero - fully transparent
   0.001,
   0.01,
   0.1,
   1,
   10
   ])

 I end up with the (deliberately) pretty horrible looking plot in the 
 attachment. The alpha values in the colors argument are completely 
 ignored, but having no colour specified for values below 0.001 (mm/hr) 
 causes those areas to be left transparent. I'm plotting the Blue 
 Marble simply to have something visible under the weather plot.

 Is this supposed to work at all in any way?

 I'm using matplotlib 1.1.0 and basemap 1.0.2 on debian with the 'Agg' 
 back-end. The data being plotted is a netCDF dataset read from the 
 output of the WRF weather model.

 Regards,
 Logi


Logi:  It looks like alpha transparency is controlled with the alpha 
keyword, so you can't specify different alphas for each contour level.  
You may have to call contourf multiple times, changing the alpha as 
needed for each set of contour levels.

-Jeff

--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contourf with rgba colours

2011-12-27 Thread Eric Firing
On 12/27/2011 03:11 PM, Jeff Whitaker wrote:
 On 12/27/11 12:07 PM, Logi Ragnarsson wrote:
 Hello,

 Is it supposed to be possible to do a filled contour plot with alpha
 levels in the colour map? I'm plotting weather data on top of maps and
 would very much like to plot low levels of wind and precipitation as
 mostly transparent, with higher levels more opaque.

 If I replace the meat of the plotting code with these two lines:

basemap.bluemarble()
basemap.contourf(x, y, precipitation,
 colors=colorConverter.to_rgba_array([
# no colour for zero -  fully transparent
(1,0,0,0.5),
(0,1,0,1),
(0,1,1,0.5),
(0,0,1,1),
(1,0,1,0.5)
]), levels=[
# no level for zero -  fully transparent
0.001,
0.01,
0.1,
1,
10
])

 I end up with the (deliberately) pretty horrible looking plot in the
 attachment. The alpha values in the colors argument are completely
 ignored, but having no colour specified for values below 0.001 (mm/hr)
 causes those areas to be left transparent. I'm plotting the Blue
 Marble simply to have something visible under the weather plot.

 Is this supposed to work at all in any way?

 I'm using matplotlib 1.1.0 and basemap 1.0.2 on debian with the 'Agg'
 back-end. The data being plotted is a netCDF dataset read from the
 output of the WRF weather model.

 Regards,
 Logi


 Logi:  It looks like alpha transparency is controlled with the alpha
 keyword, so you can't specify different alphas for each contour level.
 You may have to call contourf multiple times, changing the alpha as
 needed for each set of contour levels.

It looks like this is something I can fix by modifying ListedColormap. 
It is discarding the alpha values, and I don't think there is any reason 
it needs to do so.

Eric


 -Jeff

 --
 Write once. Port to many.
 Get the SDK and tools to simplify cross-platform app development. Create
 new or port existing apps to sell to consumers worldwide. Explore the
 Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
 http://p.sf.net/sfu/intel-appdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users