Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jul 26, 2025

The logo module's -D option has the following syntax:

-D[g|j|J|n|x]refpoint[+hheight|+wwidth][+jjustify][+odx[/dy]] 
  • [g|j|J|n|x]refpoint[+jjustify][+odx[/dy]] is common to GMT embellishments and use the Position class
  • +h: height
  • +w: width

Preview: https://pygmt-dev--4014.org.readthedocs.build/en/4014/api/generated/pygmt.Figure.logo.html

Related to #4165.

@seisman seisman changed the title Figure.logo: Refactor using the new alias system WIP: Figure.logo: Refactor using the new alias system Jul 26, 2025
Base automatically changed from AliasSystem/aliassystem to main July 29, 2025 04:09
@seisman seisman changed the title WIP: Figure.logo: Refactor using the new alias system Figure.logo: Refactor using the new alias system Sep 9, 2025
@seisman seisman added the enhancement Improving an existing feature label Sep 12, 2025
@seisman seisman added this to the 0.17.0 milestone Sep 12, 2025
@seisman seisman changed the title Figure.logo: Refactor using the new alias system Figure.logo: More Pythonic syntax to specify its location and size Sep 12, 2025
@seisman seisman changed the title Figure.logo: More Pythonic syntax to specify its location and size Figure.logo: Add parameters to specify its location and size Sep 12, 2025
@seisman seisman changed the title Figure.logo: Add parameters to specify its location and size Figure.logo: Add parameters to specify the location and size Sep 12, 2025
@seisman seisman marked this pull request as ready for review September 12, 2025 04:45
@seisman seisman added the needs review This PR has higher priority and needs review. label Sep 12, 2025
@seisman seisman changed the title Figure.logo: Add parameters to specify the location and size Figure.logo: Add Pythonic parameters to specify the location and size Sep 12, 2025
@seisman seisman added needs review This PR has higher priority and needs review. and removed final review call This PR requires final review and approval from a second reviewer labels Dec 15, 2025
raise GMTInvalidInput(msg)

# Default position at the plot origin.
if position is 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.

Force the default position to x0/0 if position is not given.

[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
**+w**\ *width*\ [**+j**\ *justify*]\ [**+o**\ *dx*\ [/*dy*]].
Set reference point on the map for the image.
position
Copy link
Member Author

@seisman seisman Dec 16, 2025

Choose a reason for hiding this comment

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

Currently, position accept a Position object. I'm debating if we should support a tuple or an anchor code:

  • position=(0, 2): equivalent to position=Position((0, 2)) and is converted to "x0/2"
  • position="BL": equivalent to position=Position("BL") and is converted to "jBL".

Copy link
Member Author

Choose a reason for hiding this comment

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

Implemented in 9b7f0f5.

@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 Dec 17, 2025
@seisman
Copy link
Member Author

seisman commented Dec 17, 2025

@GenericMappingTools/pygmt-maintainers Please give this PR a final review. Plan to merge in 24 hours if no further comments.

Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 18, 2025
@seisman seisman merged commit 938e8ec into main Dec 18, 2025
23 of 24 checks passed
@seisman seisman deleted the refactor/logo branch December 18, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants