Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yt-project
GitHub Repository: yt-project/yt
Path: blob/main/doc/source/cookbook/annotations.py
928 views
1
import yt
2
3
ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046")
4
p = yt.ProjectionPlot(ds, "z", ("gas", "density"))
5
p.annotate_sphere([0.54, 0.72], radius=(1, "Mpc"), coord_system="axis", text="Halo #7")
6
p.annotate_sphere(
7
[0.65, 0.38, 0.3],
8
radius=(1.5, "Mpc"),
9
coord_system="data",
10
circle_args={"color": "green", "linewidth": 4, "linestyle": "dashed"},
11
)
12
p.annotate_arrow([0.87, 0.59, 0.2], coord_system="data", color="red")
13
p.annotate_text([10, 20], "Some halos", coord_system="plot")
14
p.annotate_marker([0.45, 0.1, 0.4], coord_system="data", color="yellow", s=500)
15
p.annotate_line([0.2, 0.4], [0.3, 0.9], coord_system="axis")
16
p.annotate_timestamp(redshift=True)
17
p.annotate_scale()
18
p.save()
19
20