I am trying to replace the colorbar given by "hp.mollview" with a custom one. In particular I am interested in:
Minimal amount of code:
import numpy as np
import healpy as hp
m = np.arange(hp.nside2npix(32))
hp.mollview(m)
Any help?
I'll expand my comment here:
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
m = np.arange(hp.nside2npix(32))
hp.mollview(m, cbar=None)
fig = plt.gcf()
ax = plt.gca()
image = ax.get_images()[0]
cmap = fig.colorbar(image, ax=ax)
Then you can customize the colorbar
with the function arguments.