File: velocity_vectors_on_slice.py

package info (click to toggle)
yt 4.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 76,192 kB
  • sloc: python: 125,909; ansic: 6,303; cpp: 3,590; sh: 556; javascript: 352; makefile: 131; csh: 36
file content (10 lines) | stat: -rw-r--r-- 223 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
import yt

# Load the dataset.
ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")

p = yt.SlicePlot(ds, "x", ("gas", "density"))

# Draw a velocity vector every 16 pixels.
p.annotate_velocity(factor=16)
p.save()