Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yt-project
GitHub Repository: yt-project/yt
Path: blob/main/doc/source/cookbook/overplot_grids.py
928 views
1
import yt
2
3
# Load the dataset.
4
ds = yt.load("Enzo_64/DD0043/data0043")
5
6
# Make a density projection.
7
p = yt.ProjectionPlot(ds, "y", ("gas", "density"))
8
9
# Modify the projection
10
# The argument specifies the region along the line of sight
11
# for which particles will be gathered.
12
# 1.0 signifies the entire domain in the line of sight.
13
p.annotate_grids()
14
15
# Save the image.
16
# Optionally, give a string as an argument
17
# to name files with a keyword.
18
p.save()
19
20