Skip to content

Commit

Permalink
feat: add grd2cpt and shading to profile map
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Dec 10, 2023
1 parent 1f75666 commit 2440c27
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/antarctic_plots/profile.py
Expand Up @@ -969,11 +969,24 @@ def plot_profile(

# plot imagery, or supplied grid as background
# can't use maps.plot_grd becauseit reset projection
if kwargs.get("map_grd2cpt", False) is True:
pygmt.grd2cpt(
cmap=kwargs.get("map_cmap", "earth"),
grid=kwargs.get("map_background", fetch.imagery()),
region=map_reg,
background=True,
continuous=True,
verbose="q",
)
cmap = True
else:
cmap = kwargs.get("map_cmap", "earth")
fig.grdimage(
region=map_reg,
projection=map_proj,
grid=kwargs.get("map_background", fetch.imagery()),
cmap=kwargs.get("map_cmap", "earth"),
shading=kwargs.get("map_shading", False),
cmap=cmap,
verbose="q",
)

Expand Down Expand Up @@ -1346,11 +1359,24 @@ def plot_data(

# plot imagery, or supplied grid as background
# can't use maps.plot_grd becauseit reset projection
if kwargs.get("map_grd2cpt", False) is True:
pygmt.grd2cpt(
cmap=kwargs.get("map_cmap", "earth"),
grid=kwargs.get("map_background", fetch.imagery()),
region=map_reg,
background=True,
continuous=True,
verbose="q",
)
cmap = True
else:
cmap = kwargs.get("map_cmap", "earth")
fig.grdimage(
region=map_reg,
projection=map_proj,
grid=kwargs.get("map_background", fetch.imagery()),
cmap=kwargs.get("map_cmap", "earth"),
shading=kwargs.get("map_shading", False),
cmap=cmap,
verbose="q",
)

Expand Down

0 comments on commit 2440c27

Please sign in to comment.