-
Notifications
You must be signed in to change notification settings - Fork 235
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
base: main
Are you sure you want to change the base?
Conversation
a46dc2c to
59f2b18
Compare
2cc02fb to
4b7b799
Compare
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 |
8078a84 to
1a8ea29
Compare
1a8ea29 to
f2f22c3
Compare
michaelgrund
left a comment
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.
Looks good!
be05942 to
c3954bf
Compare
|
I think this feature is also ready for review. The key point that we need to reach an agreement on is the default position. As shown below, GMT defaults to plot directional roses at
I'll file an upstream issue report later (GenericMappingTools/gmt#8841), but I feel in PyGMT, we should let the default position to
|
Co-authored-by: Yvonne Fröhlich <[email protected]>
b45132f to
f5090de
Compare
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.
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 <[email protected]>
Co-authored-by: Copilot <[email protected]>


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