Skip to content

Instantly share code, notes, and snippets.

@adigitoleo
adigitoleo / gmt_tutorial_s1.jl
Created July 19, 2021 15:03
GMT.jl translation of the GMT tutorial (session 1)
"""GMT tutorial using GMT.jl
1. In the Julia shell, do `]add GMT`
2. Download GSHHG data: <http://www.soest.hawaii.edu/wessel/gshhg/>
3. Unpack GSHHG data to a predictable directory
4. Create the `.gmt` folder in your HOME directory
5. In the command line shell, run `gmt defaults -Ds > .gmt/gmt.conf`
6. Change the assignment of `DIR_GSHHG` to point to the directory from step 3
"""
@adigitoleo
adigitoleo / mpl_colorwheel.py
Last active October 1, 2020 06:47
Plot colorwheel inset in matplotlib (Python).
"""Color wheel for matplotlib plots."""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import inset_locator
def add_cwheel(ax_parent, rect, label, cmap=None, half=True, nticks=4):
"""Add color wheel to a matplotlib axes.