Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Aug 10, 2025

The full syntax of -D option is:

-D[g|j|J|n|x]<refpoint>+w<width>[/<height>][+j<justify>][+o<dx>[/<dy>]]
  • [g|j|J|n|x]<refpoint>[+j<justify>][+o<dx>[/<dy>]]: position
  • +w: width, height

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

Related to #4250.

TODO in separate PRs

  • Update gallery examples.

@seisman seisman added the enhancement Improving an existing feature label Sep 18, 2025
@seisman seisman added this to the 0.18.0 milestone Sep 18, 2025
@seisman seisman changed the base branch from main to params/position November 25, 2025 15:00
Base automatically changed from params/position to main December 11, 2025 01:54
@seisman seisman changed the title WIP: Figure.inset: Refactor using the new alias system Figure.inset: Add parameters position/width/height to specify inset position and dimensions Dec 13, 2025
@seisman seisman marked this pull request as ready for review December 13, 2025 13:12
Comment on lines -71 to -83
Alternatively, give *west/east/south/north* of geographic
rectangle bounded by parallels and meridians; append **+r** if the
coordinates instead are the lower left and upper right corners of
the desired rectangle. (Or, give *xmin/xmax/ymin/ymax* of bounding
rectangle in projected coordinates and optionally
append **+u**\ *unit* [Default coordinate unit is meters (**e**)].
Copy link
Member Author

@seisman seisman Dec 14, 2025

Choose a reason for hiding this comment

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

inset's -D option can also accept west/east/south/north. An example is:

gmt begin map png
    gmt coast -Rg -JH15c -Baf -Ggray
    gmt inset begin -D100/130/30/60 -F
    gmt inset end
gmt end show

The output is:
Image

The syntax is a little weird, so I've removed it from the docstrings.

@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 14, 2025
@seisman seisman force-pushed the refactor/inset branch 2 times, most recently from 52ee4cf to ea0b43d Compare December 18, 2025 11:02
@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 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_inset_default_position.png

Image diff(s)

Details

Added images

  • test_inset_default_position.png

Modified images

Path Old New

Report last updated at commit b699935

@seisman
Copy link
Member Author

seisman commented Dec 18, 2025

This PR is also ready for review.

The key points we need to reach an agreement on are:

@seisman seisman force-pushed the refactor/inset branch 3 times, most recently from 41c0a42 to 3618dcd Compare December 18, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing 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