Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yt-project
GitHub Repository: yt-project/yt
Path: blob/main/doc/source/cookbook/global_phase_plots.py
928 views
1
import yt
2
3
# load the dataset
4
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
5
6
# This is an object that describes the entire box
7
ad = ds.all_data()
8
9
# We plot the average velocity magnitude (mass-weighted) in our object
10
# as a function of density and temperature
11
plot = yt.PhasePlot(
12
ad, ("gas", "density"), ("gas", "temperature"), ("gas", "velocity_magnitude")
13
)
14
15
# save the plot
16
plot.save()
17
18