Skip to content

DOC: Add gallery example to show usage of map roses#4010

Open
michaelgrund wants to merge 38 commits intomainfrom
gallery-map-roses
Open

DOC: Add gallery example to show usage of map roses#4010
michaelgrund wants to merge 38 commits intomainfrom
gallery-map-roses

Conversation

@michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Jul 23, 2025

Description of proposed changes

This PR adds a gallery example to show the usage of map roses.

Preview:

https://pygmt-dev--4010.org.readthedocs.build/en/4010/gallery/embellishments/map_roses.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

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Jul 23, 2025
@michaelgrund michaelgrund changed the title DOC: Add gallery example to usage of map roses DOC: Add gallery example to show usage of map roses Jul 23, 2025
@michaelgrund michaelgrund added the needs review This PR has higher priority and needs review. label Jul 23, 2025
@yvonnefroehlich
Copy link
Member

yvonnefroehlich commented Jul 23, 2025

Cool - will look at the plots in detail later on.

But just want to mention that there is an issue suggesting to implemente a high-level methods for plotting a directional rose etc. at #2831 (similar to plot / plot3d at #2797). Not sure if there is any progress at the moment, but would be good to check to avoid double work 🙃. As the script contains various plots, it looks like you put already some work into this PR.

@seisman
Copy link
Member

seisman commented Jul 24, 2025

But just want to mention that there is an issue suggesting to implemente a high-level methods for plotting a directional rose etc. at #2831 (similar to plot / plot3d at #2797). Not sure if there is any progress at the moment

It's still waiting for the new alias system.

Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@seisman
Copy link
Member

seisman commented Jul 24, 2025

Instead of plotting eight roses in eight subplots, maybe it's better to plot eight roses in a single basemap?

michaelgrund and others added 2 commits July 28, 2025 11:40
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@seisman
Copy link
Member

seisman commented Jul 29, 2025

@michaelgrund @yvonnefroehlich I've opened PR #4025 which adds the Figure.directional_rose method. With that feature added, this gallery example can be greatly simplified. So better to focus on that PR first?

@michaelgrund
Copy link
Member Author

@michaelgrund @yvonnefroehlich I've opened PR #4025 which adds the Figure.directional_rose method. With that feature added, this gallery example can be greatly simplified. So better to focus on that PR first?

Great, will wait until #4025 is merged!

@seisman seisman removed the needs review This PR has higher priority and needs review. label Jul 30, 2025
@seisman seisman marked this pull request as draft July 30, 2025 11:20
@seisman seisman added this to the 0.18.0 milestone Sep 18, 2025
@seisman seisman modified the milestones: 0.18.0, 0.19.0 Dec 29, 2025
@yvonnefroehlich yvonnefroehlich mentioned this pull request Jan 6, 2026
30 tasks
@seisman
Copy link
Member

seisman commented Jan 23, 2026

@michaelgrund The Figure.directional_rose method in PR #4025 has been merged. You may want to revisit this example if you're still interested.

michaelgrund and others added 3 commits February 3, 2026 09:25
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@michaelgrund
Copy link
Member Author

/format

@michaelgrund
Copy link
Member Author

/format

michaelgrund and others added 3 commits February 5, 2026 15:20
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
directional roses on maps. Using ``pygmt.Figure.directional_rose()``
without any arguments will plot a rose at the bottom left corner,
but this example will focus on customizing its position and
apperance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
apperance.
appearance.

=====================

The :meth:`pygmt.Figure.directional_rose` method allows to add
directional roses on maps. Using ``pygmt.Figure.directional_rose()``
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
directional roses on maps. Using ``pygmt.Figure.directional_rose()``
directional roses on maps. Using the method

fig.directional_rose(
width=width,
labels=True,
position=Position((20, y0), cstype="mapcoords"),
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can use plotcoords in the example, so the command can fit on one line, making it much shorter:

fig.directional_rose(width=width, labels=True, position=(1, 1), fancy=True)

@seisman
Copy link
Member

seisman commented Feb 7, 2026

I feel it would be better if we could find all GMT parameters (e.g., FONT_TITLE) that control the appearance of map roses and provide dedicated parameters for them. For example, it's sometimes confusing that the label font is controlled by FONT_TITLE rather than FONT_LABEL. It would be more user-friendly if we can provide a parameter like font_label (or labe_font).

Anyway, we can finish this gallery example first, then implement these parameters and update the gallery example in separate PRs.

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

Labels

documentation Improvements or additions to documentation needs review This PR has higher priority and needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants