-
Notifications
You must be signed in to change notification settings - Fork 234
Figure.grdview: Improve parameters plane/facade_fill/facade_pen to set the plane and facade #4235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Report last updated at commit 571b314 |
There was a problem hiding this 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
planeparameter into two distinct parameters:planefor z-level specification andfacadefillfor facade fill color - Migrated
facadepenfrom the old@use_aliasdecorator to the newAliasSystem - Added automatic plane enabling when
facadefillorfacadepenis 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.
|
Changes in this PR will affect our Figure 3, so ping @yvonnefroehlich for a review. |
…e_pen, meshpen->mesh_pen (Will be removed in v0.20.0)
6d5264f to
82cd782
Compare
3a637e5 to
2c13607
Compare
…o set the plane and facade
2c13607 to
06ee20e
Compare
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| facade_fill="gray", # Fill the facade with "gray" | |
| facade_fill="gray", # Color the facade in "gray" |

This PR splits the
-Noption into two parameters,planefor setting the z-level andfacade_fillfor 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