Wind Barbs Example#

Download this notebook from GitHub (right-click to download).


import numpy as np
import geoviews as gv

gv.extension('matplotlib')

gv.output(fig='svg', size=200)

Define data#

lat = np.arange(60, 37.5, -2.5)
lon = np.arange(270, 292.5, 2.5)
uwnd = np.array(
    [
        [2, 0, -2, -2, -3, -3, -3, -2, -1],
        [2, 0, -2, -2, -2, -2, -2, -1, 1],
        [2, -1, -2, -2, -2, -1, 0, 1, 3],
        [3, 0, -3, -5, -5, -4, -4, -2, 0],
        [8, 4, 0, -3, -5, -6, -6, -6, -5],
        [12, 10, 8, 5, 3, 0, -2, -2, -2],
        [13, 14, 16, 16, 14, 12, 10, 9, 10],
        [13, 18, 22, 24, 25, 24, 23, 22, 23],
        [20, 25, 29, 32, 33, 32, 32, 33, 34],
    ]
)
vwwnd = np.array(
    [
        [3, 1, 0, -1, -1, 0, 1, 3, 4],
        [-2, -3, -3, -2, 0, 2, 4, 6, 8],
        [-6, -6, -4, -1, 2, 5, 7, 10, 12],
        [-12, -10, -6, -1, 4, 7, 10, 12, 14],
        [-17, -15, -10, -4, 2, 6, 9, 12, 16],
        [-20, -18, -14, -8, -2, 2, 5, 10, 16],
        [-17, -16, -13, -9, -6, -3, 1, 7, 15],
        [-11, -10, -8, -6, -6, -5, -2, 6, 15],
        [-5, -3, -2, -2, -4, -5, -2, 6, 15],
    ]
)

wind_barbs = gv.WindBarbs.from_uv((lon, lat, uwnd, vwwnd)).opts(
    fig_size=250, length=6.5, padding=1
)
coastline = gv.feature.coastline()

Plot#

wind_barbs * coastline
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).