Skip to content

Figure.plot: Add alias "fill_between" for option -M#3169

Merged
seisman merged 8 commits into
mainfrom
add-plot-alias-M
Apr 10, 2026
Merged

Figure.plot: Add alias "fill_between" for option -M#3169
seisman merged 8 commits into
mainfrom
add-plot-alias-M

Conversation

@yvonnefroehlich

@yvonnefroehlich yvonnefroehlich commented Apr 14, 2024

Copy link
Copy Markdown
Member

Description of proposed changes

This PR aims to add an alias for M of plot (new in GMT 6.5.0).
Sofar I use fillcurves. But @GenericMappingTools/gmt-maintainers feel free to make suggestions for another / a better alias 🙂. Edit: changed to fill_between.

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 command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added the enhancement Improving an existing feature label Apr 14, 2024
@yvonnefroehlich yvonnefroehlich added this to the 0.12.0 milestone Apr 14, 2024
@yvonnefroehlich yvonnefroehlich self-assigned this Apr 14, 2024
@yvonnefroehlich

Copy link
Copy Markdown
Member Author

/format

@yvonnefroehlich

Copy link
Copy Markdown
Member Author

/format

@seisman

seisman commented Apr 15, 2024

Copy link
Copy Markdown
Member

This reminds me the fill_between method in matplotlib, so another high-level method for Figure.plot. I guess we need to focus on #2797 in PyGMT v0.13.0.

@yvonnefroehlich

Copy link
Copy Markdown
Member Author

This reminds me the fill_between method in matplotlib, so another high-level method for Figure.plot. I guess we need to focus on #2797 in PyGMT v0.13.0.

You are probably right, and a high-level method would be more user-friendly and more Pythonic. Despite this, should I still continue working on adding an alias for M or should we close this PR and the PR for the related gallery example?

@seisman

seisman commented Apr 18, 2024

Copy link
Copy Markdown
Member

This reminds me the fill_between method in matplotlib, so another high-level method for Figure.plot. I guess we need to focus on #2797 in PyGMT v0.13.0.

You are probably right, and a high-level method would be more user-friendly and more Pythonic. Despite this, should I still continue working on adding an alias for M or should we close this PR and the PR for the related gallery example?

Personally I prefer to have v0.12.0 released soon and then focus on improving Figure.plot/Figure.plot3d and implementing the proposed high-level wrappers (#2797) in v0.13.0. With the new wrappers, the gallery examples you're working on can be greatly simplified.

@yvonnefroehlich

Copy link
Copy Markdown
Member Author

This reminds me the fill_between method in matplotlib, so another high-level method for Figure.plot. I guess we need to focus on #2797 in PyGMT v0.13.0.

You are probably right, and a high-level method would be more user-friendly and more Pythonic. Despite this, should I still continue working on adding an alias for M or should we close this PR and the PR for the related gallery example?

Personally I prefer to have v0.12.0 released soon and then focus on improving Figure.plot/Figure.plot3d and implementing the proposed high-level wrappers (#2797) in v0.13.0. With the new wrappers, the gallery examples you're working on can be greatly simplified.

I agree that we should focus to get v0.12.0 out soon (even if I can not state how much I can help out in the next time).
I converted the PRs for the "stem plot" (#3052) and "filled curves" (#3168) gallery examples to drafts.

@yvonnefroehlich yvonnefroehlich marked this pull request as draft April 18, 2024 21:07
@seisman seisman modified the milestones: 0.12.0, 0.13.0 Apr 19, 2024
@seisman seisman removed this from the 0.13.0 milestone Apr 29, 2024
@yvonnefroehlich yvonnefroehlich changed the title WIP: Figure.plot: Add alias "fillcurves" for "M" WIP: Figure.plot: Add alias "fill_curves" for "M" Apr 9, 2026
@yvonnefroehlich yvonnefroehlich marked this pull request as ready for review April 9, 2026 19:20
@yvonnefroehlich yvonnefroehlich changed the title WIP: Figure.plot: Add alias "fill_curves" for "M" WIP: Figure.plot: Add alias "fill_between" for "M" Apr 10, 2026
@yvonnefroehlich yvonnefroehlich added the needs review This PR has higher priority and needs review. label Apr 10, 2026
@yvonnefroehlich yvonnefroehlich changed the title WIP: Figure.plot: Add alias "fill_between" for "M" Figure.plot: Add alias "fill_between" for "M" Apr 10, 2026
@seisman seisman added this to the 0.19.0 milestone Apr 10, 2026
@seisman seisman changed the title Figure.plot: Add alias "fill_between" for "M" Figure.plot: Add alias "fill_between" for option -M Apr 10, 2026
@seisman seisman merged commit 42533ad into main Apr 10, 2026
18 of 24 checks passed
@seisman seisman deleted the add-plot-alias-M branch April 10, 2026 09:22
@seisman seisman removed the needs review This PR has higher priority and needs review. label Apr 10, 2026
Comment thread pygmt/src/plot.py
I="intensity",
L="close",
N="no_clip",
M="fill_between",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am sorry, but it should be between_fill to be consistent with the renaming and the other parameter names.

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.

Actually, I think it should be fill_between, which is more consistent with matplotlib's fill_between method (https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.fill_between.html)

@yvonnefroehlich yvonnefroehlich Apr 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm. For Figure.wiggle, we have positive_fill and negative_fill.

What do the others think here @GenericMappingTools/pygmt-maintainers?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Continued in PR #4527.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants