Add Figure.directional_rose to plot a directional rose on map#4025
Merged
Add Figure.directional_rose to plot a directional rose on map#4025
Conversation
6 tasks
a46dc2c to
59f2b18
Compare
6 tasks
2cc02fb to
4b7b799
Compare
Contributor
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)DetailsAdded images
Modified images
Report last updated at commit 8d70181 |
25 tasks
This was referenced Oct 15, 2025
8078a84 to
1a8ea29
Compare
1a8ea29 to
f2f22c3
Compare
25 tasks
be05942 to
c3954bf
Compare
b45132f to
f5090de
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the Figure.directional_rose method to plot directional roses on maps, wrapping GMT's basemap -Td / coast -Td options. It also deprecates the rose parameter in the basemap method in favor of this new dedicated method.
Changes:
- Adds new
Figure.directional_rosemethod with support for position, width, fancy levels (1-3), custom labels, and background box - Deprecates the
roseparameter inFigure.basemapwhile maintaining backward compatibility - Updates existing test to use the new method instead of the deprecated parameter
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pygmt/src/directional_rose.py | New module implementing the directional_rose method with comprehensive parameter support |
| pygmt/src/basemap.py | Deprecates rose parameter, adds deprecation warning, maintains backward compatibility |
| pygmt/tests/test_directional_rose.py | Comprehensive test suite covering default, fancy, and complex usage scenarios |
| pygmt/tests/test_inset.py | Updates test to use new directional_rose method instead of deprecated basemap rose parameter |
| pygmt/src/init.py | Registers the new directional_rose function |
| pygmt/figure.py | Adds directional_rose to the Figure class methods |
| doc/api/index.rst | Adds directional_rose to API documentation index |
| pygmt/tests/baseline/*.dvc | Baseline test images for visual regression testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
yvonnefroehlich
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Description of proposed changes
This PR adds the
Figure.directional_rosemethod to plot a map directional rose on map. It wraps thebasemap -Td/coast -Tdoptions.[g|j|J|n|x]<refpoint>[+j<justify>][+o<dx>[/<dy>]]:position+w<width>:width+f[<level>]:fancy+l<w,e,s,n>]:labelsExample
Preview: https://pygmt-dev--4025.org.readthedocs.build/en/4025/api/generated/pygmt.Figure.directional_rose.html
Addressing #2831. Related to #4010. Related to #4164.
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash command is:
/format: automatically format and lint the code