import pygmt
# Load sample earth relief data
grid = pygmt.datasets.load_earth_relief(resolution="10m", region=[109, 117.4, 20, 25.6])
fig = pygmt.Figure()
fig.grdview(
grid=grid,
# Set the azimuth to -130 (230) degrees and the elevation to 30 degrees
perspective=[-130, 30],
frame=["xaf", "yaf", "WSnE"],
projection="M15c",
zsize="1.5c",
surftype="s",
cmap="geo",
plane="1000+ggrey",
# Set the contour pen thickness to "0.1p"
contourpen="0.1p",
)
fig.colorbar(perspective=True, frame=["a500", "x+lElevation", "y+lm"])
fig.show()
it reports the following errors:
Traceback (most recent call last):
File “d:\python\PyFile\gmt\temp.py”, line 1, in
import pygmt
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt_init_.py”, line 29, in
with clib.Session() as lib:
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 217, in enter
self.create(“pygmt-session”)
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 364, in create
c_create_session = self.get_libgmt_func(
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 316, in get_libgmt_func
self._libgmt = load_libgmt()
^^^^^^^^^^^^^
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\loading.py”, line 59, in load_libgmt
raise GMTCLibNotFoundError(“\n”.join(error_msg))
pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at ‘gmt.dll’.
Could not find module ‘gmt.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
Error loading GMT shared library at ‘gmt_w64.dll’.
Could not find module ‘gmt_w64.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
Error loading GMT shared library at ‘gmt_w32.dll’.
Could not find module ‘gmt_w32.dll’ (or one of its dependencies). Try using the full path with constructor syntax.