geospatial-python
geospatial-python copied to clipboard
Improve aesthetics of geospatial plots, particularly axis ticks

It'd be great if by default geospatial plots did not truncate axis ticks.
In the meantime, there is an easy one liner to change a setting to display axis ticks without truncation: plt.ticklabel_format(style="plain")
I only found out about this later on when developing the lesson, so maybe this line should lead each episode, or the first episode, to ensure that learner's plots look cleaner from the start.
@rbavery, I'm testing this locally and the plt.ticklabel_format(style="plain") line must be called for each plot, i.e. it does not work if I run it on the first cell of a notebook and then create the plot on a different cell. Is this the same for you?
I'm trying to think if there's a way to set this using Matplotlib's rcParams.
I'll check this out later while working on some new episodes, thanks @vinisalazar
@rbavery How about using the axes.formatter.limits rcParam? Setting the upper bound to 7 forces the truncated UTM coordinates to print as plain numbers.
# Force large numbers in tick labels to print in full
mpl.rcParams["axes.formatter.limits"] = -5, 7
Thanks for the tip @adamancer looks helpful! I think that'll work