Hi !
I have a FITS/Healpix map that I plot using Mollview, like in
this link
I have no problems adding the grid (graticule), but how can I add the tick labels ??
How is it possible to add (and then modify) the tick labels with healpy.mollview(...) ?
Thanks a lot for your help !
B.
I didn't work with
healpy
, but its graphical facilities are likely built up on top of matplotlib.
Are you trying to add tick labels to the colorbar at bottom of the
mollview
? If so, you can try the following approach: set keyword argument
cbar=False
, e.g.
mollview(...., ...., cbar=False)
,
and than try to crate colorbar manually, e.g.
# prevent jupyter to show plots without invoking `plt.show()` # you probably need to remove matplotlib inline?
hp.mollview(wmap_map_I_masked.filled(), cbar=False)
fig = plt.gcf()
ax = plt.gca()
fig.colorbar()
cbar = fig.colorbar(cax, ticks=[-1, 0, 1], orientation='horizontal') # set some values to ticks
cbar.ax.set_xticklabels(['negative', 'zero', 'positive'])
...
# finally:
plt.show()
Thanks a lot for your reply !
Actually, this is not what I try to do.
I want to add tick labels directly on the axis of the mollview plot that I plotted directly with hp.mollview like in the example you give, to obtain a mollweide grid like
in this link.
When plotting directly the map with hp.mollview, I can figure a way to add the tick label. Adding the grid works (hp.graticule()), but there are no tick labels...
Thanks...
B.
Unfortunately,
it seems that the only way to create labels is to use matplotlib...
Thanks a lot for the link, I will try that.
But this is unfortunate that maps plotted with healpy cannot be modified ?
No way to handle/modify the maps plotted with hp.mollview ?
Thanks,
B.