Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve aesthetics of geospatial plots, particularly axis ticks #22

Open
rbavery opened this issue Oct 23, 2020 · 4 comments
Open

Improve aesthetics of geospatial plots, particularly axis ticks #22

rbavery opened this issue Oct 23, 2020 · 4 comments
Labels
good first issue Good issue for first-time contributors help wanted Looking for Contributors January Sprint Issue to be tackled during end of January sprint (dates tbd)

Comments

@rbavery
Copy link
Collaborator

rbavery commented Oct 23, 2020

12-phenology-with-points-plot-03

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 rbavery added good first issue Good issue for first-time contributors help wanted Looking for Contributors labels Oct 23, 2020
@vinisalazar
Copy link
Contributor

@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.

vinisalazar added a commit to vinisalazar/geospatial-python that referenced this issue Apr 16, 2021
…arpentries-incubator#22).

  - Move the 'Plotting Tip' block from Episode 05 to Episode 06
  - Add a new block 'Customizing plots with Matplotlib in Episode 06
@rbavery
Copy link
Collaborator Author

rbavery commented Apr 21, 2021

I'll check this out later while working on some new episodes, thanks @vinisalazar

@adamancer
Copy link
Contributor

@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

@rbavery
Copy link
Collaborator Author

rbavery commented Nov 2, 2021

Thanks for the tip @adamancer looks helpful! I think that'll work

@rbavery rbavery added the January Sprint Issue to be tackled during end of January sprint (dates tbd) label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good issue for first-time contributors help wanted Looking for Contributors January Sprint Issue to be tackled during end of January sprint (dates tbd)
Projects
None yet
Development

No branches or pull requests

3 participants