import pygmt fig = pygmt.Figure() fig.plot(x=[1,2,3,4,5], y=[2,4,6,8,10], style='L') fig.show()
import pygmt import pandas as pd data = pd.read_csv('data.csv') fig = pygmt.Figure() fig.grdimage(grid=data, cmap='jet', shading=True) fig.show()
import pygmt import numpy as np theta = np.linspace(0, 2*np.pi, 100) r = np.sin(5*theta) + 2 fig = pygmt.Figure() fig.plot(x=theta, y=r, style='c0.2', projection='P5/-60') fig.show()This code creates a polar plot with radial and angular axes. The plot uses a sine function to generate the data points and the 'c0.2' style to plot data as circles. The projection argument is used to create the polar coordinates. Overall, Python pygmt is a powerful and flexible package library for creating scientific plots and maps. It can be used in various fields like geosciences, oceanography, and more.