Skip to content

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

Merged
seisman merged 21 commits into
mainfrom
gallery-scatter-hist
Mar 12, 2023
Merged

seisman merged 21 commits into
mainfrom
gallery-scatter-hist

Conversation

@michaelgrund

@michaelgrund michaelgrund commented Mar 10, 2023 •

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

/format

@michaelgrund michaelgrund added the needs review This PR has higher priority and needs review. label Mar 10, 2023
@michaelgrund

Copy link
Copy Markdown
Member Author

/format

@michaelgrund

Copy link
Copy Markdown
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
Copy Markdown
Member Author

/format

@seisman

seisman commented Mar 11, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member Author

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

@yvonnefroehlich

yvonnefroehlich commented Mar 11, 2023 •

Copy link
Copy Markdown
Member

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.

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

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.

@seisman
seisman merged commit 133834d into main Mar 12, 2023
@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.

5 participants