Skip to content

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.

  • [g|j|J|n|x]<refpoint>[+j<justify>][+o<dx>[/<dy>]]: position
  • +w<width>: width
  • +f[<level>]: fancy
  • +l<w,e,s,n>]: labels

Example

import pygmt
from pygmt.params import Position
fig = pygmt.Figure()
fig.basemap(region=[0, 80, -30, 30], projection="M10c", frame=True)
fig.directional_rose(width="3c")
fig.show()

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

  • 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 2 times, most recently 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 seisman added this to the 0.17.0 milestone Aug 24, 2025
@seisman seisman changed the title WIP: Add Figure.directional_rose to plot a directional rose on map Add Figure.directional_rose to plot a directional rose on map Sep 6, 2025
@seisman seisman force-pushed the feature/direction_rose branch from 2cc02fb to 4b7b799 Compare September 8, 2025 06:45
@weiji14 weiji14 modified the milestones: 0.17.0, 0.18.0 Sep 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_directional_rose.png
added pygmt/tests/baseline/test_directional_rose_complex.png
added pygmt/tests/baseline/test_directional_rose_fancy.png

Image diff(s)

Details

Added images

  • test_directional_rose.png

  • test_directional_rose_complex.png

  • test_directional_rose_fancy.png

Modified images

Path Old New

Report last updated at commit 8d70181

@seisman seisman marked this pull request as ready for review October 15, 2025 02:36
@seisman seisman added needs review This PR has higher priority and needs review. and removed needs review This PR has higher priority and needs review. labels Oct 15, 2025
@seisman seisman force-pushed the feature/direction_rose branch from 8078a84 to 1a8ea29 Compare December 15, 2025 07:11
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 15, 2025
@seisman seisman force-pushed the feature/direction_rose branch from 1a8ea29 to f2f22c3 Compare December 15, 2025 07:25
Copy link
Member

@michaelgrund michaelgrund left a comment

Choose a reason for hiding this comment

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

Looks good!

@seisman seisman added this to the 0.19.0 milestone Dec 29, 2025
@seisman seisman added the needs review This PR has higher priority and needs review. label Jan 12, 2026
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Jan 21, 2026
Copy link
Contributor

Copilot AI left a 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_rose method with support for position, width, fancy levels (1-3), custom labels, and background box
  • Deprecates the rose parameter in Figure.basemap while 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.

seisman and others added 4 commits January 21, 2026 21:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Jan 23, 2026
@seisman seisman merged commit faae537 into main Jan 23, 2026
23 of 24 checks passed
@seisman seisman deleted the feature/direction_rose branch January 23, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Brand new feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants