Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jul 26, 2025

GMT long names are available at: https://github.com/GenericMappingTools/gmt/blob/831be10910cb15bc6e9a0a0bf49bfd57861a3f8a/src/longopt/psbasemap_inc.h#L39

The full syntax of -L is:

-L[g|j|J|n|x]refpoint+wlength[e|f|k|M|n|u][+aalign][+c[[slon/]slat]][+f][+jjustify][+l[label]][+odx[/dy]][+u][+v]

Here is a comparison of names used in PyGMT, GMT, and GMT.jl:

modifier PyGMT GMT GMT.jl
+w length length length
+a label_alignment align align
+c scale_position loc scale_at_lat
+l label label label
+u unit units units
+v vertical vertical vertical

Related to #4268.

Preview: https://pygmt-dev--4015.org.readthedocs.build/en/4015/api/generated/pygmt.Figure.scalebar.html#pygmt.Figure.scalebar

TODO in separate PRs

  • Update gallery examples using the new scalebar method
  • Deprecate map_scale in Figure.coast/Figure.basemap
  • Update the example in the paper

Base automatically changed from AliasSystem/aliassystem to main July 29, 2025 04:09
@seisman seisman force-pushed the feature/scalebar branch 3 times, most recently from 7a276b0 to ec9b800 Compare July 29, 2025 06:57
@seisman seisman added the feature Brand new feature label Aug 10, 2025
@seisman seisman added this to the 0.18.0 milestone Sep 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 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_scalebar.png
added pygmt/tests/baseline/test_scalebar_cartesian.png
added pygmt/tests/baseline/test_scalebar_complete.png

Image diff(s)

Added images

  • test_scalebar.png

  • test_scalebar_cartesian.png

  • test_scalebar_complete.png

Modified images

Path Old New

Report last updated at commit 3e95670

@seisman seisman changed the title WIP: Add Figure.scalebar to plot a scale bar on maps \Add Figure.scalebar to plot a scale bar on maps Dec 10, 2025
@seisman seisman changed the title \Add Figure.scalebar to plot a scale bar on maps Add Figure.scalebar to plot a scale bar on maps Dec 10, 2025
Base automatically changed from params/position to main December 11, 2025 01:54
self,
position: Position | None = None,
length: float | str | None = None,
scale_position: float | Sequence[float] | bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

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

GMT uses loc, GMT.jl uses scale_at_lat, and PyGMT uses scale_position?

Maybe scale_location or scale_lonlat?

length: float | str | None = None,
scale_position: float | Sequence[float] | bool = False,
label: str | bool = False,
label_alignment: Literal["left", "right", "top", "bottom"] | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

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

GMT and GMT.jl use align, currently PyGMT uses label_alignment, but maybe label_position?

scale_position: float | Sequence[float] | bool = False,
label: str | bool = False,
label_alignment: Literal["left", "right", "top", "bottom"] | None = None,
unit: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

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

GMT and GMT.jl uses units, but I feel unit makes more sense here.

@seisman seisman marked this pull request as ready for review December 11, 2025 11:49
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Brand new feature needs review This PR has higher priority and needs review.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants