GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
758 stars 220 forks source link

plot3d along with grdview is not working #1275

Closed vivigb closed 3 years ago

vivigb commented 3 years ago
import pygmt

minlon, maxlon = 79,80.5
minlat, maxlat = 29,31
region=[minlon, maxlon,minlat, maxlat]
perspective=[210,30]
frame =  ["xa0.5f0.25","ya0.5f0.25", "z2000+lmeters", "WSenZ"]
KWARGS = dict(grid='himalaya.nc',region=region, projection='M15c',perspective=perspective,frame=frame) #frame="a0.5f" for tick interval

pygmt.makecpt(
        cmap='geo',
        series=f'1000/8000/100',
        continuous=True
    )

fig.grdview(
    grid='himalaya.nc',
    region=[minlon, maxlon, 30, maxlat,0, 8000],
    perspective=perspective,
    frame=frame,
    projection="M15c",
    zsize="3c",
    surftype="i",
    plane="0+gazure",
    shading='shadow.nc+a45',
    # Set the contour pen thickness to "1p"
    contourpen="1p"
)

fig.basemap(
    perspective=True,
    rose="jTL+w2c+l+o13c/-2c+f3+lN" #map directional rose at the top left corner 
)

fig.plot3d(x=79.726631,y=30.375713,z=5600,perspective=perspective,style='c0.15i',color='blue',pen='black') # M>6

Here When I give the shading=0,everything is working perfect.But when I put shading='shadow.nc+a45', plot3d is not working, even though the script is executing without any error messages.

weiji14 commented 3 years ago

Hi @vivigb, we might need a bit more information to reproduce your issue and help you debug the situation. Could you please provide:

  1. The plots you are getting with shading=0 and shading='shadow.nc+a45. Use fig.savefig("shading.png") and upload the files as a comment.
  2. The output of print(pygmt.show_versions()) so we know the versions of PyGMT/GMT and other libraries you are using.
  3. A copy of himalaya.nc and shadow.nc. You may need to zip up the files to upload onto GitHub. If that isn't possible, please provide the output of pygmt.grdinfo(himalaya.nc) and pygmt.grdinfo(shadow.nc) so we can get an idea of those two grids.

Thanks.

seisman commented 3 years ago

Ping @vivigb to provide more information to reproduce the issue.

seisman commented 3 years ago

Closing the issue as we don't get any feedback to reproduce the issue.