Previous topic

Modifying the boundary/neatline of a map in cartopy

Next topic

tick_labels example

This Page

streamplot exampleΒΆ

(Source code)

import matplotlib.pyplot as plt

import as ccrs
from cartopy.examples.arrows import sample_data

def main():
    ax = plt.axes(projection=ccrs.PlateCarree())
    ax.set_extent([-90, 75, 10, 60])

    x, y, u, v, vector_crs = sample_data(shape=(80, 100))
    magnitude = (u ** 2 + v ** 2) ** 0.5
    ax.streamplot(x, y, u, v, transform=vector_crs,
                  linewidth=2, density=2, color=magnitude)

if __name__ == '__main__':