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

Add gallery example for scatter plot with histograms on sides #2410

Merged
merged 21 commits into from Mar 12, 2023

Conversation

michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Mar 10, 2023

Description of proposed changes

This PR adds a new gallery example showing a combination of a scatter plot with histograms on the sides. This is often used but I found no documentation in the GMT universe for this use-case. Inspired by matplotlib.

Preview: https://pygmt-dev--2410.org.readthedocs.build/en/2410/gallery/histograms/scatter_and_histograms.html

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.
  • Use underscores (not hyphens) in names of Python files and directories.

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

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Mar 10, 2023
@michaelgrund michaelgrund added this to the 0.9.0 milestone Mar 10, 2023
@michaelgrund michaelgrund self-assigned this Mar 10, 2023
@michaelgrund michaelgrund changed the title Create scatter_and_histograms Create gallery example for scatter plot with histograms on sides Mar 10, 2023
@michaelgrund michaelgrund marked this pull request as draft March 10, 2023 12:05
@michaelgrund michaelgrund changed the title Create gallery example for scatter plot with histograms on sides Add gallery example for scatter plot with histograms on sides Mar 10, 2023
@michaelgrund michaelgrund marked this pull request as ready for review March 10, 2023 13:18
@michaelgrund
Copy link
Member Author

/format

@michaelgrund michaelgrund added the needs review This PR has higher priority and needs review. label Mar 10, 2023
michaelgrund and others added 2 commits March 11, 2023 15:10
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@michaelgrund
Copy link
Member Author

/format

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
michaelgrund and others added 2 commits March 11, 2023 15:51
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@michaelgrund
Copy link
Member Author

I have undone the changes regarding frame=["wSrt", "x+a1", "y+lCounts"] since in my opinion it's nice to have ticks along the axis of the histograms.

@michaelgrund
Copy link
Member Author

/format

@seisman
Copy link
Member

seisman commented Mar 11, 2023

I have undone the changes regarding frame=["wSrt", "x+a1", "y+lCounts"] since in my opinion it's nice to have ticks along the axis of the histograms.

I think what you should use is xf1, not x+a1.

@michaelgrund
Copy link
Member Author

/format

@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 Mar 11, 2023
@michaelgrund
Copy link
Member Author

Is the chosen "Histograms" category the right one for this example @GenericMappingTools/pygmt-maintainers ?

@yvonnefroehlich
Copy link
Member

yvonnefroehlich commented Mar 11, 2023

Is the chosen "Histograms" category the right one for this example @GenericMappingTools/pygmt-maintainers ?

I think the (more) interesting part of this figure are the histograms at the sides (not the scatter plot in the center), thus I would leave it as is in the "Histograms" category. There is also already a stand-alone gallery example for a Scatter plot.

michaelgrund and others added 2 commits March 11, 2023 18:00
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
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.

Nice example! Just two minor suggestions.

examples/gallery/histograms/scatter_and_histograms.py Outdated Show resolved Hide resolved
examples/gallery/histograms/scatter_and_histograms.py Outdated Show resolved Hide resolved
@seisman seisman merged commit 133834d into main Mar 12, 2023
7 checks passed
@seisman seisman deleted the gallery-scatter-hist branch March 12, 2023 13:46
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Mar 12, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants