Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Dec 2, 2025

This PR splits the -N option into two parameters, plane for setting the z-level and facade_fill for setting the fill for facade.

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

Related to #4208

@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Dec 2, 2025
@seisman seisman added this to the 0.18.0 milestone Dec 2, 2025
@github-actions
Copy link
Contributor

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

Image diff(s)

Added images

  • test_grdview_facadepen_default_plane.png

Modified images

Path Old New

Report last updated at commit 571b314

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the Figure.grdview method by refactoring how plane and facade parameters are handled. It migrates facadepen to the new alias system and splits the GMT -N option into two separate parameters (plane and facadefill) for better API clarity.

Key changes:

  • Split the plane parameter into two distinct parameters: plane for z-level specification and facadefill for facade fill color
  • Migrated facadepen from the old @use_alias decorator to the new AliasSystem
  • Added automatic plane enabling when facadefill or facadepen is specified

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pygmt/src/grdview.py Updated function signature with new parameters, migrated to AliasSystem for -N and -Wf options, added auto-enable logic for plane
pygmt/tests/test_grdview.py Updated existing test to use new API, added new test for facadepen with default plane
pygmt/tests/baseline/test_grdview_facadepen_default_plane.png.dvc Added baseline image for new test case
examples/tutorials/advanced/draping_on_3d_surface.py Updated examples to use new facadefill parameter instead of plane="+g..." syntax
examples/tutorials/advanced/3d_perspective_image.py Updated examples and comments to use new facadefill parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

seisman commented Dec 4, 2025

Changes in this PR will affect our Figure 3, so ping @yvonnefroehlich for a review.

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 6, 2025
@seisman seisman marked this pull request as draft December 6, 2025 02:42
…e_pen, meshpen->mesh_pen (Will be removed in v0.20.0)
@seisman seisman changed the base branch from main to grdview/facadepen December 9, 2025 08:53
@seisman seisman force-pushed the grdview/facade branch 2 times, most recently from 3a637e5 to 2c13607 Compare December 9, 2025 08:56
@seisman seisman changed the title Figure.grdview: Improve parameters 'plane'/'facadefill'/'facadepen' to set the plane and facade Figure.grdview: Improve parameters plane/facade_fill/facade_pen to set the plane and facade Dec 9, 2025
Base automatically changed from grdview/facadepen to main December 10, 2025 02:21
@seisman seisman marked this pull request as ready for review December 10, 2025 02:27
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 10, 2025
@seisman seisman requested a review from a team December 11, 2025 02:03
Comment on lines +113 to +117
plane
Draw a plane at the specified z-level. If ``True``, default to the minimum value
in the grid. However, if ``region`` was used to set zmin/zmax then that value is
used if it is less than the grid minimum value. Use ``facade_pen`` and
``facade_fill`` to control the appearance of the plane.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
plane
Draw a plane at the specified z-level. If ``True``, default to the minimum value
in the grid. However, if ``region`` was used to set zmin/zmax then that value is
used if it is less than the grid minimum value. Use ``facade_pen`` and
``facade_fill`` to control the appearance of the plane.
plane
Draw a plane at the specified z-level. If ``True``, defaults to the minimum value
in the grid. However, if ``region`` was used to set *zmin/zmax* then *zmin* is
used if it is less than the grid minimum value. Use ``facade_pen`` and
``facade_fill`` to control the appearance of the plane.

data perimeter.
facade_pen
Set the pen attributes used for the facade.
shading : str
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
shading : str
shading : str or float

# Set the plane elevation to 1,000 meters and make the fill "gray"
plane="1000+ggray",
plane=1000, # Set the plane elevation to 1,000 meters
facade_fill="gray", # Fill the facade with "gray"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
facade_fill="gray", # Fill the facade with "gray"
facade_fill="gray", # Color the facade in "gray"

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.

4 participants