[AstroPy] all-sky map

Jonathan Slavin jslavin at cfa.harvard.edu
Thu Apr 7 13:35:47 EDT 2011


Erik,

I tried that script on my system (Linux CentOS 5.5, but with newer
versions of python and matplotlib installed) and got an empty circle
(note: not an ellipse).  I also got this message three times:
Warning: invalid value encountered in divide
I don't know what the issue is.  My matplotlib version is 1.0.0.

Jon

> Whoops, sorry, you're aboslutely right - I left out a very important
> line!  The corrected version (the key change being the addition of the
> call to "axes" with the projection keyword) is:
> 
> import matplotlib
> matplotlib.use('agg') #I tried a few other backends and got the same
> result
> 
> from matplotlib.pyplot import figure,axes,imshow,savefig
> from numpy.random import randn
> from math import pi
> 
> img = randn(100,100)
> 
> figure(figsize=(10,5))
> axes(projection='mollweide')
> imshow(img,extent=(-pi,pi,-pi/2,pi/2))
> savefig('filename.png')
> 
> 
> 
> Also, when I run your script you linked to, I get the following three
> images (tested both on a Snow Leopard Mac and Ubuntu Lucid, both with
> matplotlib 1.0.1):
> http://dl.dropbox.com/u/8683962/allsky1.png
> http://dl.dropbox.com/u/8683962/allsky2.png
> http://dl.dropbox.com/u/8683962/allsky3.png
> 
> And as you can see, 2 and 3 have colored imshow ovals rather than
> blank.  This makes me think this is a bug that was fixed at some point
> (if you're using a version earlier than 1.0.1), or some rendering
> problem that is platform-specific (if you're using something other
> than OS X or Linux)... Definitely very weird behavior, though!




More information about the AstroPy mailing list