Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pygmt/src/grdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def grdview(
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.
**Note**: For GMT<=6.6.0, *zmin* set in ``region`` has no effect due to a GMT
**Note**: For GMT<=6.7.0, *zmin* set in ``region`` has no effect due to a GMT
bug.
facade_fill
Fill for the frontal facade between the plane specified by ``plane`` and the
Expand Down Expand Up @@ -295,16 +295,17 @@ def grdview(
if plane is False and (facade_fill is not None or facade_pen is not None):
plane = True

# Workaround for GMT bug https://github.com/GenericMappingTools/gmt/pull/8838
# Workaround for GMT bugs https://github.com/GenericMappingTools/gmt/pull/8838 and
# https://github.com/GenericMappingTools/gmt/pull/9123.
# Fix the plane value to be the grid minimum if plane=True.
# Notes:
# 1. It's the minimum of the grid, not a subset of the grid defined by 'region'.
# 2. The GMT docs says "if -R was used to set zmin/zmax then we use that value if
# it is less than the grid minimum value.". We can't add a workaround for this
# case since we can't parse zmin/zmax from 'region' if 'region' was set in
# previous plotting commands.
# TODO(GMT>6.6.0): Remove this workaround.
if Version(__gmt_version__) <= Version("6.6.0") and plane is True:
# TODO(GMT>6.7.0): Remove this workaround.
if Version(__gmt_version__) <= Version("6.7.0") and plane is True:
plane = grdinfo(grid, per_column=True).split()[4]

aliasdict = AliasSystem(
Expand Down
Loading