Skip to content

Figure.pygmtlogo: Initial version for the circular, colored PyGMT logo - #3849

Merged
seisman merged 434 commits into
pygmtlogofrom
code-pygmt-logo
May 2, 2026
Merged

Figure.pygmtlogo: Initial version for the circular, colored PyGMT logo#3849
seisman merged 434 commits into
pygmtlogofrom
code-pygmt-logo

Conversation

@yvonnefroehlich

@yvonnefroehlichyvonnefroehlich commented Mar 13, 2025

Copy link
Copy Markdown
Member

Description of proposed changes

Related to #1404 (comment), create the PyGMT logo in Python with PyGMT:

  • Python script
  • Separate method Figure.pygmtlogo or Figure.logo_pygmt as part of the Figure class or
    addition to the method Figure.logo (which plots the GMT logo)
  • Documentation
  • Tests -> only circular, color, light and dark themes
  • Gallery example -> separate PR

Related to

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

imageimageimageimage
imageimageimageimage
imageimageimageimage

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

@yvonnefroehlichyvonnefroehlich added the documentation Improvements or additions to documentation label Mar 13, 2025
@yvonnefroehlichyvonnefroehlich self-assigned this Mar 13, 2025
@yvonnefroehlichyvonnefroehlich changed the title Add first version of PyGMT code for PyGMT logoPOC: DOC: Code PyGMT logo in PyGMT and add as gallery exampleMar 13, 2025
@yvonnefroehlich

Copy link
Copy Markdown
MemberAuthor

/format

@michaelgrund

michaelgrund commented Mar 13, 2025

Copy link
Copy Markdown
Member

I feel the logo definition should be separated into a standalone method, similar to the method to plot the GMT logo. This would allow to plot the PyGMT logo by calling something like pygmt.Figure.pygmt_logo. The individual formats could be selected by different input parameters like you did or hex = True or darkmode = True.

Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
@yvonnefroehlich
yvonnefroehlich marked this pull request as draft March 13, 2025 13:27
@yvonnefroehlichyvonnefroehlich changed the title POC: DOC: Code PyGMT logo in PyGMT and add as gallery examplePOC: DOC: Code PyGMT logo in PyGMT (method Figure.pygmt_logo and gallery example)Mar 13, 2025
@yvonnefroehlichyvonnefroehlich added the feature Brand new feature label Mar 13, 2025
@yvonnefroehlichyvonnefroehlich changed the title POC: DOC: Code PyGMT logo in PyGMT (method Figure.pygmt_logo and gallery example)POC: Code PyGMT logo in PyGMT (method Figure.pygmt_logo and gallery example)Mar 13, 2025
@yvonnefroehlichyvonnefroehlich changed the title POC: Code PyGMT logo in PyGMT (method Figure.pygmt_logo and gallery example)POC: Code PyGMT logo in PyGMT (method or / and gallery example)Mar 13, 2025
@yvonnefroehlich

Copy link
Copy Markdown
MemberAuthor

ruff v0.10.0 was released 2 hours ago causing the newly falling code style checks.

@weiji14weiji14 mentioned this pull request Mar 13, 2025
6 tasks
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
@seismanseisman reopened this Mar 13, 2025
@yvonnefroehlichyvonnefroehlich changed the title POC: Code PyGMT logo in PyGMT (method or / and gallery example)POC: Code PyGMT logo in PyGMTMar 14, 2025
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
@seisman

Copy link
Copy Markdown
Member
  • separat method Figure.pygmtlogo or Figure.logo_pygmt as part of the Figure class or addition to the method Figure.logo (which plots the GMT logo)

@yvonnefroehlich You can follow the steps below:

  1. Create a pygmtlogo.py file under the pygmt/src/ directory
  2. Move the current pygmtlogo function to this file
  3. Add self as the first parameter of the pygmtlogo function
  4. Change fig.image (line 269) to self.image.
  5. Add from pygmt.src.pygmtlogo import pygmtlogo in pygmt/src/__init__.py
  6. Near line 429 in pygmt/figure.py, add pygmtlogo.

Then, you should be able to call Figure.pygmtlogo to add the logo.

Comment threadpygmt/src/pygmtlogo.py Outdated
Comment threadpygmt/src/pygmtlogo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadpygmt/src/pygmtlogo.py Outdated
Comment threadexamples/gallery/embellishments/pygmt_logo.py Outdated
Comment threadpygmt/tests/baseline/test_pygmtlogo.png.dvc Outdated
Comment threadpygmt/src/pygmtlogo.py Outdated
Comment threadpygmt/src/pygmtlogo.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment threadpygmt/src/pygmtlogo.py
@seisman
seisman changed the base branch from main to pygmtlogoMay 2, 2026 03:57
@seismanseisman changed the title Code PyGMT logo in PyGMTFigure.pygmtlogo: Initial version for the circular PyGMT logoMay 2, 2026
@seismanseisman changed the title Figure.pygmtlogo: Initial version for the circular PyGMT logoFigure.pygmtlogo: Initial version for the circular, colored PyGMT logoMay 2, 2026
@seisman

Copy link
Copy Markdown
Member

I think the circular, colored version of the PyGMT logo is good enough to be finalized. I've changed the base branch to pygmtlogo and updated the PR title.

OK to merge after addressing comment #3849 (comment).

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@seisman

Copy link
Copy Markdown
Member

/format

@seisman
seisman merged commit 4868c8a into pygmtlogoMay 2, 2026
16 of 20 checks passed
@seisman
seisman deleted the code-pygmt-logo branch May 2, 2026 08:17
@seisman
seisman restored the code-pygmt-logo branch May 2, 2026 08:17
@seisman
seisman deleted the code-pygmt-logo branch August 21, 2026 11:46
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureBrand new feature

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

@yvonnefroehlich@michaelgrund@seisman@weiji14@actions-bot