2D contour plot with streamlines

Author Update time

This demos shows how to reading 2D simulation data, zoom-in to a region of interest, and add streamlines on top of colored mesh.

using Vlasiator, Plots

file = "bulk.0000501.vlsv"
nameρ = "rho"
nameV = "rho_v"

boxcoords = Float64[0, 20, -15, 15]

meta = load(file)

heatmap(meta, nameρ,
   xlim=(boxcoords[1], boxcoords[2]),
   ylim=(boxcoords[3], boxcoords[4]),
   aspect_ratio=:equal,
   c=:turbo)

#=
# Attributes can be modified afterwards, but it's slower.
heatmap(meta, nameρ, c=:turbo)
xlims!(boxcoords[1], boxcoords[2])
ylims!(boxcoords[3], boxcoords[4])
=#

streamplot(meta, nameV, comp="xy", color="w", density=2.0)

This page was generated using DemoCards.jl.