Commit d331ea22 authored by teresa.bister's avatar teresa.bister Committed by Teresa Bister
Browse files

[skymap] enable cb labels and [simulations] arrivals map now has true source id in cb

parent 5244de5e
Pipeline #225888 passed with stages
in 6 minutes and 22 seconds
......@@ -813,7 +813,8 @@ class SourceBound(BaseSimulation):
cmap.set_under('gray')
if len(src_idx) > 0:
skymap.eventmap(self.crs['vecs'][:, idx], c=labels_p, cmap=cmap, cblabel='Source ID',
cticks=np.arange(-1, len(src_idx), 1), vmin=-0.5, vmax=len(src_idx)-0.5)
cticks=np.arange(0, len(src_idx)+1, 1), clabels=np.sort(src_idx),
vmin=-0.5, vmax=len(src_idx)-0.5)
else:
skymap.eventmap(self.crs['vecs'][:, idx], c='gray')
lon_src, lat_src = coord.vec2ang(self.universe.sources[:, idx])
......
......@@ -47,6 +47,7 @@ def scatter(v, c=None, cblabel='log$_{10}$(Energy / eV)', opath=None, **kwargs):
vmax = kwargs.pop('vmax', smart_round(np.max(c[finite]), upper_border=True))
step = smart_round((vmax - vmin) / 5., order=1)
cticks = kwargs.pop('cticks', np.arange(vmin, vmax, step))
clabels = kwargs.pop('clabels', cticks)
# read keyword arguments for the grid
dark_grid = kwargs.pop('dark_grid', True)
......@@ -75,6 +76,7 @@ def scatter(v, c=None, cblabel='log$_{10}$(Energy / eV)', opath=None, **kwargs):
cbar.set_label(cblabel, fontsize=fontsize)
events.set_clim(vmin, vmax)
cbar.ax.tick_params(labelsize=fontsize - 4)
cbar.set_ticklabels(clabels)
cbar.draw_all()
# Setup the grid
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment