It seems that GMT can be used in Python, so I will add it. https://www.pygmt.org/dev/install.html
python
conda create -n pygmt python=3.8.2
conda activate pygmt
conda install pip numpy pandas xarray netcdf4 packaging gmt
conda install pygmt -c conda-forge
conda install ipython jupyter jupyterlab -c conda-forge
Follow the tutorial.
python
conda install pytest pytest-mpl ipython
Start python
and
python
import pygmt
pygmt.show_versions()
pygmt.test()
Message returned
python
============================== 53 failed, 212 passed, 1 skipped, 353 warnings in 83.38s (0:01:23) ==============================
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kanon/local/anaconda3/envs/pygmt/lib/python3.8/site-packages/pygmt/__init__.py", line 187, in test
assert status == 0, "Some tests have failed."
AssertionError: Some tests have failed.
I feel like I've failed quite a bit, is this okay?
I also included GMT5, so I tried setting GMT_LIBRARY_PATH
as in the tutorial, but the number of ** failed ** did not change.
I drew a picture according to the tutorial.
python
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[-90,-70,0,20], projection="M8i", frame=True)
fig.coast(shorelines=True)
fig.show()
fig.savefig("test_pygmt.png ")
It worked! However, I can't see anything when Jupyter Lab is in Dark mode ... oh
Recommended Posts