Skip to content

Figure.scalebar: Improve docstrings for parameters label_alignment/fancy - #4868

Open
seisman wants to merge 1 commit into
mainfrom
scalebar/doc
Open

Figure.scalebar: Improve docstrings for parameters label_alignment/fancy#4868
seisman wants to merge 1 commit into
mainfrom
scalebar/doc

Conversation

@seisman

@seisman seisman commented Aug 27, 2026

Copy link
Copy Markdown
Member

@seisman seisman added this to the 0.20.0 milestone Aug 27, 2026
@seisman seisman added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Aug 27, 2026
Comment thread pygmt/src/scalebar.py
@@ -71,19 +71,20 @@ def scalebar(
[Default is ``"km"``]. Requires ``fancy=True``.
label_alignment
Alignment of the scale bar label. Choose from ``"left"``, ``"right"``,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread pygmt/src/scalebar.py
If ``True``, draw a "fancy" scale bar, which is a segmented bar with alternating
black and white rectangles. If ``False``, draw a plain scale bar. Only supported
for non-Cartesian projections.
black and white rectangles. If ``False``, draw a plain scale bar. Doesn't work

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

GMT allows fancy scales in Cartesian projection after GenericMappingTools/gmt#9069 (first appeared in GMT 6.7.0).

@seisman seisman changed the title Figure.scalebar: Improve docstrings for parameters label_alignment/fancy/vertical Figure.scalebar: Improve docstrings for parameters label_alignment/fancy Aug 28, 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 Aug 30, 2026
@seisman
seisman requested review from a team and a lite review from Copilot August 30, 2026 03:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves the Figure.scalebar parameter docstrings to better reflect GMT’s actual defaults and version-dependent behavior, making the generated API documentation clearer and more accurate.

Changes:

  • Clarify label_alignment default behavior based on scale bar orientation (horizontal vs vertical).
  • Update fancy documentation to reflect the GMT version constraint for Cartesian projections (pre-6.7.0).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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 final review call This PR requires final review and approval from a second reviewer skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants