File: simple_1d_line_plot.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 (16 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import yt

# Load the dataset
ds = yt.load("SecondOrderTris/RZ_p_no_parts_do_nothing_bcs_cone_out.e", step=-1)

# Create a line plot of the variables 'u' and 'v' with 1000 sampling points evenly
# spaced between the coordinates (0, 0, 0) and (0, 1, 0)
plot = yt.LinePlot(
    ds, [("all", "v"), ("all", "u")], (0.0, 0.0, 0.0), (0.0, 1.0, 0.0), 1000
)

# Add a legend
plot.annotate_legend(("all", "v"))

# Save the line plot
plot.save()