Deprecation warning: Use Matplotlib to load the colormaps

49 views
Skip to first unread message

Jonathan Slavin

unread,
May 1, 2018, 4:21:35 PM5/1/18
to SunPy
Hi,

I just updated to the latest version of sunpy and now plotting maps for Hinode XRT I get:
SunpyDeprecationWarning: Use Matplotlib to load the colormaps
  self.plot_settings['cmap'] = cm.get_cmap(name='hinodexrt')

This is odd since all I'm doing is:
m = sunpy.map.Map(file)
m.plot()
show()
In fact the warning is shown as soon as load the file.

Ah, found it.  It seems that in sunpy/map/sources/hinode.py the line
        self.plot_settings['cmap'] = cm.get_cmap(name='hinodexrt')
needs to be replaced with
        self.plot_settings['cmap'] = plt.get_cmap(name='hinodexrt')
(with "import matplotlib.pyplot as plt" added to the file as well).

Jon

Stuart Mumford

unread,
May 4, 2018, 3:29:18 PM5/4/18
to su...@googlegroups.com

Hi Jon,

Thanks for the bug report, it looks like we missed some of the old code when we deprecated that function. I have opened a bug on our tracker https://github.com/sunpy/sunpy/issues/2616 and we will fix it for the next bug fix.

Stuart

--
You received this message because you are subscribed to the Google Groups "SunPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.
To post to this group, send email to su...@googlegroups.com.
Visit this group at https://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages