Skip to content

Migrate the 'no_clip' parameter to the new alias system - #4103

Merged
seisman merged 9 commits into
mainfrom
no_clip
Sep 25, 2025
Merged

seisman merged 9 commits into
mainfrom
no_clip

Conversation

@seisman

@seisman seisman commented Sep 18, 2025

Copy link
Copy Markdown
Member

Some wrappers have the no_clip parameter, which can be either False or True. This PR migrates the parameter to the new alias system.

no_clip in Figure.plot and Figure.plot3d are not updated in this PR, because in these two methods, no_clip can be False, True, "c" or "r" and we need to discuss the long-form arguments for "c"/"r". So leave it to a separate PR instead.

@seisman seisman added this to the 0.17.0 milestone Sep 18, 2025
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Sep 18, 2025
Comment thread pygmt/src/contour.py Outdated
Comment on lines +113 to +115
no_clip
Do **not** clip contours or image at the frame boundaries [Default is ``False``
to fit inside ``region``].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am wondering to what "image" is refering here.

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.

It comes from the upstream documentation at https://docs.generic-mapping-tools.org/6.5/contour.html#n.

Here "image" is used because contour can color the triangles using a CPT. See the example below:

gmt begin map
    gmt makecpt -Cseis -T600/1000/100
    gmt basemap -R0.5/6/0.5/6 -JX10c/10c -Baf
    gmt plot @Table_5_11.txt -Sc0.2c
    gmt contour @Table_5_11.txt -Wthin -C -I -N -t50
gmt end show
map

@yvonnefroehlich yvonnefroehlich Sep 25, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, thanks for the example 🙂!
Not really happy with this formulation, but do not have a good alternative.

Comment thread pygmt/src/grdimage.py Resolved
Comment thread pygmt/src/contour.py Resolved
Comment thread pygmt/src/contour.py Resolved
seisman and others added 2 commits September 25, 2025 18:12
Co-authored-by: Yvonne Fröhlich <[email protected]>
Co-authored-by: Yvonne Fröhlich <[email protected]>
@seisman seisman removed the needs review This PR has higher priority and needs review. label Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants