

Start and/or activate the current figure. The text is released under the CC-BY-NC-ND license, and code is released under the MIT license.If you find this content useful, please consider supporting the work by buying the book! For people who are only interested in running pygmt in a notebook, the size of the image isn't too important: just as you don't specify an image size when using things like imshow, it would probably be best to set this to some default value. import pygmt import pandas as pd import numpy as np import xarray as xr from scipy.interpolate import griddata. note:: This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook. In addition, the PyGMT software was released its beta version last year (2020). If you don't have the data files already, they are automatically downloaded and saved to a cache directory the first time you use them (usually ~/.gmt/cache ). Jupyter Visual Studio Code supports working with Jupyter Notebooks natively, and through Python code files. Integration with the Jupyter notebook to display plots and maps inline. Integration with the PyData ecosystem: numpy.ndarray or pandas.DataFrame for data tables, xarray.DataArray for grids and geopandas.GeoDataFrame for geographical data. As the output in the screenshot shows, the Python kernel of Jupyter you are using is "Python3.8.5", but the module "pygmt" is not installed in this environment. This tutorial will progressively cover PyGMT plotting concepts, and later examples will use concepts explained in previous examples.

A quick way to test this is to type import pygmt in a Python IDE or Jupyter Notebook.

This is an excerpt from the Python Data Science Handbook by Jake VanderPlas Jupyter notebooks are available on GitHub. This post is about reading an ASCII file whose first few lines contain the header information and then the three-component data, and then finally writing it into the Mseed (or SAC) formatted file. I'm not sure if you can click on it, but you'll probably need to find a way to change it to "conda: pygmt (Python 3.8.X)". Example script to visualize topographic data, earthquake data, and tomographic data on a map Topics.

You can view the original Jupyter notebook on nbviewer.
