Skip to content

WIP: Add Figure.directional_rose to plot a directional rose on map #4025

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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

seisman
Copy link
Member

@seisman seisman commented Jul 29, 2025

Description of proposed changes

This PR adds the Figure.directional_rose method to plot a map directional rose on map. It wraps the basemap -Td/coast -Td options.

Addressing #2831. Related to #4010.

Example

import pygmt
fig = pygmt.Figure()
fig.basemap(region=[0, 80, -30, 30], projection="M10c", frame=True)
fig.directional_rose(position=(10, 10), position_type="user")
fig.show()

Preview: https://pygmt-dev--4025.org.readthedocs.build/en/4025/api/generated/pygmt.Figure.directional_rose.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.

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

@seisman seisman added the feature Brand new feature label Jul 29, 2025
@seisman seisman force-pushed the feature/direction_rose branch from 84fc545 to a46dc2c Compare July 29, 2025 07:54
@seisman seisman force-pushed the feature/direction_rose branch from a46dc2c to 59f2b18 Compare July 29, 2025 08:38
@seisman seisman changed the title Add Figure.directional_rose to plot a directional rose on map WIP: Add Figure.directional_rose to plot a directional rose on map Jul 30, 2025
seisman and others added 2 commits July 30, 2025 13:48
Comment on lines 38 to 42
- ``position_type="justify"``: *position* is given as a two-character
justification code, meaning the anchor point of the rose is inside the map
bounding box.
- ``position_type="mirror"``: *position* is given as a two-character
justification code, but the rose is outside the map bounding box.
Copy link
Member

Choose a reason for hiding this comment

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

Hm. I am not sure if "justify" and "mirror" are suitable / understandable terms here, especially "mirror" appears a bit strange for me. Is this orientated on some other implementaiton or documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

All the parameters/arguments need more discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants