[AstroPy] all-sky map

Matthew Turk matthewturk at gmail.com
Thu Apr 7 14:31:32 EDT 2011


Hi Mike,

Unfortunately, it seems that one of the colorbar handling operations
in yt (the package I work on) was affected by a change somewhere
between 1.0.0 and the current tip.  Looking over the official
changelog (http://matplotlib.sourceforge.net/_static/CHANGELOG)
doesn't give any hints as to what would have changed.  This results in
empty colorbars for all image plots as set up in yt.  I'm going to try
to track it down, but I think until I can figure out which aspect of
the API changed I'm going to use the (10,5) figsize and 0.5 aspect
ratio for sky projections.

Thanks very much for your help with all this,

Matt

On Thu, Apr 7, 2011 at 2:25 PM, Michael Droettboom <mdroe at stsci.edu> wrote:
> 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.
>
> Mike
>
> 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
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>



More information about the AstroPy mailing list