Skip to content

Add colorbars to plots of gallery and tutorial examples #2190

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

Merged
merged 58 commits into from
Dec 28, 2022

Conversation

yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Nov 16, 2022

Description of proposed changes
This PR aims to add colorbars to some plots of the gallery and tutorial examples:

Fixes #2030

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@yvonnefroehlich yvonnefroehlich added the documentation Improvements or additions to documentation label Nov 16, 2022
@yvonnefroehlich yvonnefroehlich added this to the 0.8.0 milestone Nov 16, 2022
@yvonnefroehlich
Copy link
Member Author

I extended issue #2030 and added also to Plotting a surface a colorbar. Furthermore, I added a grid. Of course, we can discuss these changes!


Strictly speaking, two colorbars have to be added to Sampling along tracks, as there are color-codings for both the bathymetry ("gray") and the sampled bathymetry points ("terra"). Should I add both colorbars or only the one for the sampled bathymetry points?

@seisman
Copy link
Member

seisman commented Nov 19, 2022

I extended issue #2030 and added also to Plotting a surface a colorbar. Furthermore, I added a grid. Of course, we can discuss these changes!

Adding the grid looks good to me.

Strictly speaking, two colorbars have to be added to Sampling along tracks, as there are color-codings for both the bathymetry ("gray") and the sampled bathymetry points ("terra"). Should I add both colorbars or only the one for the sampled bathymetry points?

Yes, two colorbars makes more sense. It's also a good example to show how to add two colorbars on the same map.

@seisman
Copy link
Member

seisman commented Dec 12, 2022

@yvonnefroehlich Thanks for your active contributions to the PyGMT project. On behalf of the PyGMT maintainers @GenericMappingTools/pygmt-maintainers, I’d like to invite you to join the “PyGMT Devs” Slack channel, which is used usually for some internal discussions. Please leave your email address here or send your email address to me (seisman.info#gmail.com) if you’d like to join.

@yvonnefroehlich
Copy link
Member Author

yvonnefroehlich commented Dec 12, 2022

@yvonnefroehlich Thanks for your active contributions to the PyGMT project. On behalf of the PyGMT maintainers @GenericMappingTools/pygmt-maintainers, I’d like to invite you to join the “PyGMT Devs” Slack channel, which is used usually for some internal discussions. Please leave your email address here or send your email address to me (seisman.info#gmail.com) if you’d like to join.

Thanks @GenericMappingTools/gmt-maintainers for this positive feedback 🙂!
I would be pleased to join the "PyGMT Devs" Slack channel. @seisman I send you my email address via email.
Hope I can add some useful thoughts to the discussions 😉.


I am sorry for accidentally closing this PR.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Dec 27, 2022
@yvonnefroehlich
Copy link
Member Author

yvonnefroehlich commented Dec 27, 2022

Hm. Maybe it would be fair to ask @weiji14 whether he is fine with the changes of track_sampling.py as he is the original author of this example? But not sure if he is currently available 🙂.
Edit: I think three approving reviewers should be enough for merging.

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. Maybe it would be fair to ask @weiji14 whether he is fine with the changes of track_sampling.py as he is the original author of this example? But not sure if he is currently available slightly_smiling_face. Edit: I think three approving reviewers should be enough for merging.

Sorry for the late response. The original intention of the track_sampling.py gallery example added in #308 was to showcase the grdtrack data processing function, rather than as a proper 'map' per se.

Personally, I feel that having just one colorbar (the normalized elevation one) would be enough, since the background grayscale earth_relief elevation is just for context. But I also find normalized elevation to be hard to interpret (see my comment below), so not sure what's a good plan forward 😅 What are your thoughts?

@yvonnefroehlich yvonnefroehlich modified the milestones: 0.8.0, 0.9.0 Dec 28, 2022
@yvonnefroehlich yvonnefroehlich removed the final review call This PR requires final review and approval from a second reviewer label Dec 28, 2022
@seisman
Copy link
Member

seisman commented Dec 28, 2022

The original intention of the track_sampling.py gallery example added in #308 was to showcase the grdtrack data processing function, rather than as a proper 'map' per se.

Personally, I feel that having just one colorbar (the normalized elevation one) would be enough, since the background grayscale earth_relief elevation is just for context. But I also find normalized elevation to be hard to interpret (see my comment below), so not sure what's a good plan forward 😅 What are your thoughts?

Perhaps we can rewrite the grdtrack example to something like (https://docs.gmt-china.org/latest/examples/ex026/):
image

@weiji14
Copy link
Member

weiji14 commented Dec 28, 2022

Perhaps we can rewrite the grdtrack example to something like (https://docs.gmt-china.org/latest/examples/ex026/)

Yes, how about we revert the changes to track_sampling and redesign the example in a separate PR? I think the other changes that add a colorbar are good to go.

@yvonnefroehlich
Copy link
Member Author

Perhaps we can rewrite the grdtrack example to something like (https://docs.gmt-china.org/latest/examples/ex026/)

Yes, how about we revert the changes to track_sampling and redesign the example in a separate PR? I think the other changes that add a colorbar are good to go.

That's fine with me.

@seisman
Copy link
Member

seisman commented Dec 28, 2022

Perhaps we can rewrite the grdtrack example to something like (docs.gmt-china.org/latest/examples/ex026)

Yes, how about we revert the changes to track_sampling and redesign the example in a separate PR? I think the other changes that add a colorbar are good to go.

Sounds good.

@yvonnefroehlich
Copy link
Member Author

I reverted the changes of track_sampling.py via commit ad2bd79.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Dec 28, 2022
@seisman seisman modified the milestones: 0.9.0, 0.8.0 Dec 28, 2022
@seisman seisman added the skip-changelog Skip adding Pull Request to changelog label Dec 28, 2022
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yvonnefroehlich, and sorry for the back and forth 🙂

@weiji14 weiji14 merged commit 16fc565 into main Dec 28, 2022
@weiji14 weiji14 deleted the add-colorbars-examples branch December 28, 2022 16:06
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing colorbars in examples
6 participants