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
15 changes: 12 additions & 3 deletions pygmt/tests/test_grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,27 @@ def test_grdimage_file():
condition=gmt_version <= Version("6.1.1"),
)
@check_figures_equal()
def test_grdimage_xarray_shading(grid):
@pytest.mark.parametrize(
"shading",
[True, 0.5, "+a30+nt0.8", "@earth_relief_01d_g+d", "@earth_relief_01d_g+a60+nt0.8"],
)
def test_grdimage_shading_xarray(grid, shading):
"""
Test that shading works well for xarray.
See https://github.com/GenericMappingTools/pygmt/issues/364

The ``shading`` can be True, a constant intensity, some modifiers, or
a grid with modifiers.

See https://github.com/GenericMappingTools/pygmt/issues/364 and
https://github.com/GenericMappingTools/pygmt/issues/618.
"""
fig_ref, fig_test = Figure(), Figure()
kwargs = dict(
region=[-180, 180, -90, 90],
frame=True,
projection="Cyl_stere/6i",
cmap="geo",
shading=True,
shading=shading,
)

fig_ref.grdimage("@earth_relief_01d_g", **kwargs)
Expand Down