diff --git a/scipost_django/graphs/graphs/plotkind.py b/scipost_django/graphs/graphs/plotkind.py index e22c039e8b61f00a37d92c4d34edcd5cf28caacf..50fe5b64b4164b38cf9827978197c3c0e600c329 100644 --- a/scipost_django/graphs/graphs/plotkind.py +++ b/scipost_django/graphs/graphs/plotkind.py @@ -233,7 +233,15 @@ class MapPlot(PlotKind): ax.xaxis.set_visible(False) ax.yaxis.set_visible(False) - cax.xaxis.set_ticklabels(f"{int(x)}" for x in cax.xaxis.get_ticklocs()) + # Set the colorbar ticks to integers if < 1000, else leave intact + labels = [] + for label, loc in zip(cax.get_xticklabels(), cax.get_xticks()): + if loc < 1000: + labels.append(int(loc)) + else: + labels.append(label) + + cax.set_xticklabels(labels) return fig