Re: [Matplotlib-users] imshow and projections

2008-09-05 Thread Michael Droettboom
Erik Tollerud wrote:
> I've been playing with some of the projections in matplotlib,
> recently, and have some questions/noticed some odd behavior:
>
> 1. Is there any way to activate a projection mode with the pyplot
> interface other than the subplot(111,projection='whatever') method a
> la /examples/api/custom_projection_example.py ?  Along these same
> lines, is the projection feature documented in greater detail
> somewhere?  About everything I've figured out has come from
> custom_projection_example.py ...
>   
There is some additional documentation in the new documentation here:

http://matplotlib.sourceforge.net/doc/html/devel/add_new_projection.html
> 2. I have a skymap I would like to plot using a particular projection
> - what I've been doing so far is specifying x and y coordinates using
> mgrid and calling contourf(x,y,data,100) to approximate this.  But
> what I'd rather do is something like
> imshow(data,extent=[-pi,pi,-pi/2,pi/2]) ... when I call that with a
> projection axis activated, the projection isn't honored - the image
> just appears as a regular square box.  Is there any way to get imshow
> to respect the projection?
>   
As Jae-Joon suggested, try pcolor.  It will be slower (and there are no 
interpolation options), but it should use the custom projection.  imshow 
is really optimized for uniform, rectilinear images.

Cheers,
Mike

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


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hatching not working in matplotlib 0.98

2008-09-05 Thread Michael Droettboom
Thanks for the report.  Indeed, it was drawing the fill over top of the 
hatch, rather than the other way around.  This has now been fixed in SVN 
r6068.  You can use that patch to patch your local copy, if you're not 
tracking SVN.

Cheers,
Mike

Crend King wrote:
> I tried hatch option in pylab.bar() in both matplotlib 0.98.2 and 
> 0.98.3. The hatch_demo.py in the example directory only draw four grey 
> bars, no hatch or them. However, when I try the same script on 
> matplotlib 0.91.4 (the maintainance version), it's working. I wonder 
> if it is a bug introduced recently? If so, it's good to have it fixed, 
> right?
>
> BTW: can I set the line width for the hatches?
>
> Thanks!
>
> 
> See how Windows Mobile brings your life together—at home, work, or on 
> the go. See Now 
> 
> 
>
> -
> 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-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

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


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] interger to binary

2008-09-05 Thread Marjolaine Rouault
Hi,

I was wondering if python has the equivalent of the matlab bitget.m function.

I have a large 2 dimensional variable of type uint32 which I must convert to 
binaries and then find if bit 23 of the binary for each point is 0 or 1. The 
matlab bitget function is ideal for that but I can't find much in python. The 
only thing I found was binary_repr which converts to a sting and can only be 
used for 1 point at a time.

Any suggestions?

Thanks, Marjolaine.

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] interger to binary

2008-09-05 Thread Michael Droettboom
You could do something like:

def bitget(value, bit_number):
return (value & (1 << bit_number)) != 0

which will return True or False for the given bit number, and this 
function works on numpy arrays.  (Bits are numbered base-0 -- I don't 
know if that matches matlab).

Hope that helps,
Mike

Marjolaine Rouault wrote:
> Hi,
>
> I was wondering if python has the equivalent of the matlab bitget.m function.
>
> I have a large 2 dimensional variable of type uint32 which I must convert to 
> binaries and then find if bit 23 of the binary for each point is 0 or 1. The 
> matlab bitget function is ideal for that but I can't find much in python. The 
> only thing I found was binary_repr which converts to a sting and can only be 
> used for 1 point at a time.
>
> Any suggestions?
>
> Thanks, Marjolaine.
>
>   

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


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Python for scientists file exchange

2008-09-05 Thread Kaushik Ghose
Hi Everyone,

As I've been learning python and using it more and more in my analysis work 
I've 
been wondering where I can go to post and find code snippets for python. A 
central file exchange, much like matlab's file exchange, would be great.

I'm thinking of a very streamlined, blog like interface, where you log in, 
upload a bunch of .py files and then write a little description of what the 
code 
does and add some tags to it.

So now we have a little repository where we can go and find code snippets to 
help us learn python.

Is there such a repository?

Thanks
-Kaushik


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Python for scientists file exchange

2008-09-05 Thread Michael Droettboom
There is a SciPy Cookbook here:

http://www.scipy.org/Cookbook

And also a more general Python cookbook here:

http://code.activestate.com/recipes/langs/python/

Other list members may have other resources, too, but those are two I 
use on a regular basis.

Mike

Kaushik Ghose wrote:
> Hi Everyone,
>
> As I've been learning python and using it more and more in my analysis work 
> I've 
> been wondering where I can go to post and find code snippets for python. A 
> central file exchange, much like matlab's file exchange, would be great.
>
> I'm thinking of a very streamlined, blog like interface, where you log in, 
> upload a bunch of .py files and then write a little description of what the 
> code 
> does and add some tags to it.
>
> So now we have a little repository where we can go and find code snippets to 
> help us learn python.
>
> Is there such a repository?
>
> Thanks
> -Kaushik
>
>
> -
> 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-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

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


-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] OS X Bad Aspect Ratio

2008-09-05 Thread David Warde-Farley
On 4-Sep-08, at 10:03 PM, Josh Lawrence wrote:

> Hey all,
>
> When I plot using python 2.5.2 and matplotlib 0.98.3 (and 0.98.1) I
> have the following problem. If I run a script from the command line
> that plots and saves the figure, I get the default aspect ratio of (8,
> 6). If, however, I close the plotting window and replot without
> exiting the python prompt and starting anew, the aspect changes to
> something like (8, 6.04). I can reliably get the (8, 6) aspect ratio
> if I quit the python prompt and load a new prompt. The problem only
> comes after I close the plot window and replot.

I just attempted to reproduce your problem with 0.98.3 and couldn't; I  
managed to get identical screenshots after closing the window and  
replotting.

Several things you could tell us that might help isolate the problem:

- What GUI backend? TkAgg I'm assuming? If you're unsure, import  
matplotlib and use the matplotlib.get_backend() function.
- What plotting commands are you using?
- Does the aspect ratio change if you do something simple like, say,

import numpy
from pylab import *
x = numpy.randn(50,50)
imshow(x)
(close window)
imshow(x)

import numpy
from pylab import *
x = numpy.arange(1,10)
plot(x, x**2)
(close window)
plot(x,x**2)

Neither of these lead to an aspect ratio shift for me, on OS X 10.5  
with the TkAgg backend, same version of matplotlib.

David



-
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users