[AstroPy] all-sky map

Michael Droettboom mdroe at stsci.edu
Thu Apr 7 14:25:37 EDT 2011

I can confirm that this problem exists on v1.0.0 but is fixed in 
v1.0.1... So if you're able to upgrade, that seems like the path of 
least resistance.


On 04/07/2011 01:35 PM, Jonathan Slavin wrote:
> 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!
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

More information about the AstroPy mailing list