GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Figure.histogram: Split parameter bar_width into bar_width and bar_offset by yvonnefroehlich · Pull Request #4316 · GenericMappingTools/pygmt

Conversation

@yvonnefroehlich

@yvonnefroehlich yvonnefroehlich commented Dec 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description of proposed changes

This PR splits the parameter bar_width into two parameters bar_width and bar_offset to make the codes more Pythonic.
Related to #4279 (comment). Extends #4279

Preview:

  • https://pygmt-dev--4316.org.readthedocs.build/en/4316/api/generated/pygmt.Figure.histogram.html#pygmt.Figure.histogram
  • https://www.pygmt.org/dev/tutorials/advanced/cartesian_histograms.html#grouped-bars

Guidelines

  • General Guidelines for Pull Request
  • Guidelines for Contributing Documentation
  • Guidelines for Contributing Code

Slash Commands

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

  • /format: automatically format and lint the code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yvonnefroehlich added 2 commits December 20, 2025 20:07
@yvonnefroehlich
Split bar_width into bar_width and bar_offset
5375cdc
@yvonnefroehlich
Update advanced tutorial
ec0e8a4
@yvonnefroehlich yvonnefroehlich added this to the 0.18.0 milestone Dec 20, 2025
@yvonnefroehlich yvonnefroehlich self-assigned this Dec 20, 2025
@yvonnefroehlich yvonnefroehlich added the enhancement Improving an existing feature label Dec 20, 2025
@yvonnefroehlich
yvonnefroehlich marked this pull request as draft December 20, 2025 19:35
seisman
seisman reviewed Dec 21, 2025
View reviewed changes
Comment thread examples/tutorials/advanced/cartesian_histograms.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

yvonnefroehlich and others added 5 commits December 21, 2025 14:03
@yvonnefroehlich
Add tests
ad19b4b
@yvonnefroehlich
Add error when bar_offset is given without bar_width
6c14592
@yvonnefroehlich
Add minus sign back
f6c8f0f
@yvonnefroehlich
Merge branch 'main' into split-histogram-bar_width
a5b70f7
@yvonnefroehlich
Merge branch 'main' into split-histogram-bar_width
bc5482d
seisman
seisman reviewed Dec 25, 2025
View reviewed changes
Comment thread pygmt/src/histogram.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Dec 26, 2025

Copy link
Copy Markdown
Member

Looks good to me, except for one minor comment above. Are there any changes you'd like to make?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yvonnefroehlich and others added 2 commits December 26, 2025 20:54
@yvonnefroehlich @seisman
Use quotation marks in error message
f9b9d90
Co-authored-by: Dongdong Tian <[email protected]>
@yvonnefroehlich
Merge branch 'main' into split-histogram-bar_width
2e4c0e3
@yvonnefroehlich
yvonnefroehlich marked this pull request as ready for review December 26, 2025 19:55
yvonnefroehlich and others added 2 commits December 26, 2025 21:46
@yvonnefroehlich
Add image comparison
a52e00a
Yvonne
Add test_histogram_barwidth_baroffset.png into DVC
6efb9e4
@yvonnefroehlich

yvonnefroehlich commented Dec 26, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Looks good to me, except for one minor comment above. Are there any changes you'd like to make?

I think the image comparison for the new test was missing. I tried to create the baseline image and pushed the DVC file to GitHub and the PNG file to DagsHub. But it looks like something did not work correctly. I remember that there should be a GitHub comment showing a summary of the modified or newly added baseline images. But this is currently not the case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

seisman
seisman reviewed Dec 27, 2025
View reviewed changes
Comment thread pygmt/tests/test_histogram.py Outdated
return fig


@pytest.mark.mpl_image_compare(filename="test_histogram_barwidth_baroffset.png")

@seisman seisman Dec 27, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is the default file name, so no need to specify it explicitly.

Suggested change
@pytest.mark.mpl_image_compare(filename="test_histogram_barwidth_baroffset.png")
@pytest.mark.mpl_image_compare

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@seisman seisman Dec 27, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actually I feel we don't need to add this test, because there is no complex code logic for these two parameters.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seisman

seisman commented Dec 27, 2025

Copy link
Copy Markdown
Member

Did you run dvc push?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yvonnefroehlich and others added 5 commits December 27, 2025 11:36
@yvonnefroehlich
Remove test
da861bf
@yvonnefroehlich
Remove DVC file for test image PNG
6910ab3
@yvonnefroehlich
Merge branch 'main' into split-histogram-bar_width
d7aa200
@yvonnefroehlich
Remove default test image name
888dd5c
@yvonnefroehlich
Add test image name
03dd11e
@seisman
seisman merged commit 4d5fb26 into main Dec 27, 2025
@seisman
seisman deleted the split-histogram-bar_width branch December 27, 2025 11:23
@seisman seisman mentioned this pull request Sep 7, 2026
Figure.histogram: Calculate and plot histograms #4251
Open
26 of 40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@seisman seisman seisman left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@yvonnefroehlich yvonnefroehlich

Labels

enhancement Improving an existing feature

Projects

None yet

Milestone

0.18.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yvonnefroehlich @seisman
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.