Fig3: Replace 'plane' with 'facade_fill' in Figure.grdview#17
Conversation
|
Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/GenericMappingTools/pygmt-paper-figures/pull/17 |
| " shading=True,\n", | ||
| " zsize=\"1.5c\",\n", | ||
| " plane=\"+ggray\",\n", | ||
| " facade_fill=\"gray\",\n", |
There was a problem hiding this comment.
Just wondering if we need to keep pane=True, because the default is plane=False (https://www.pygmt.org/dev/api/generated/pygmt.Figure.grdview.html)?
Edit: Since the parameters plane and facade_fill are both related to -N, it makes sense that facade_fill works without plane=True (panel c). facade_fill seems to apply a default pen (panel c), which can be overwritten by facade_pen (panel f). facade_pen is related to -Wf and it makes sense that it requires the plane parameter. For me, plane=True with specifying facade_pen does plot the outline of the facade (panel d), but an z-value has to be passed to plane (panel e). I see no difference between using the default plane=False (panel a) and setting plane=True (panel b).
import pygmt
region = [-25, -13, 63.2, 66.7]
args_basemap = {
"region": region,
"projection": "M?",
"perspective": (-150, 25),
"frame": True,
}
grd_relief = pygmt.datasets.load_earth_relief(resolution="30m", region=region)
args_grdview = {
"grid": grd_relief,
"cmap": "oleron",
"surftype": "s",
"zsize": "1c",
"perspective": True,
}
fig = pygmt.Figure()
with fig.subplot(nrows=2, ncols=3, subsize=("12c", "8.5c"), autolabel="+gwhite"):
# a
fig.basemap(panel=0, **args_basemap)
fig.grdview(**args_grdview)
# b
fig.basemap(panel=1, **args_basemap)
fig.grdview(plane=True, **args_grdview)
# c
fig.basemap(panel=2, **args_basemap)
fig.grdview(facade_fill="gray", **args_grdview)
# d
fig.basemap(panel=3, **args_basemap)
fig.grdview(plane=True, facade_pen="1p,red", **args_grdview)
# e
fig.basemap(panel=4, **args_basemap)
fig.grdview(plane=-3000, facade_pen="1p,red", **args_grdview)
# f
fig.basemap(panel=5, **args_basemap)
fig.grdview(plane=-3000, facade_fill="gray", facade_pen="1p,red", **args_grdview)
fig.show()There was a problem hiding this comment.
It makes no sense to specify facade_fill and facade_pen without drawing the z-plane, so plane is always enabled when either facade_fill or facade_pen is set.
Edit: Actually, there is a potential upstream bug at GenericMappingTools/gmt#8838.
There was a problem hiding this comment.
Actually, there is a potential upstream bug at GenericMappingTools/gmt#8838
Good to know! I think this issue is what confuses me here.
Update after GenericMappingTools/pygmt#4235.