SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 0359bced authored by George Katsikas's avatar George Katsikas :goat:
Browse files

use powers for large values in map plot colorbar

parent cbaf41ad
No related branches found
No related tags found
No related merge requests found
...@@ -233,7 +233,15 @@ class MapPlot(PlotKind): ...@@ -233,7 +233,15 @@ class MapPlot(PlotKind):
ax.xaxis.set_visible(False) ax.xaxis.set_visible(False)
ax.yaxis.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 return fig
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment