The Cookbook¶
yt provides a great deal of functionality to the user, but sometimes it can be a bit complex. This section of the documentation lays out examples recipes for how to do a variety of tasks. Most of the early, simple code demonstrations are small scripts which you can easily copy and paste into your own code; however, as we move to more complex tasks, the recipes move to iPython notebooks to display intermediate steps. All of these recipes are available for download in a link next to the recipe.
Getting the Sample Data¶
All of the data used in the cookbook is freely available here, where you will find links to download individual datasets.
If you want to take a look at more complex recipes, or submit your own, check out the yt Hub.
Note
To contribute your own recipes, please fork the documentation repository!
Example Scripts¶
- Making Simple Plots
- Simple Slices
- Simple Probability Distribution Functions
- Simple Phase Plots
- Simple 1D Histograms
- 1D Profiles Over Time
- Simple Projections
- Simple Radial Profiles
- Profiles with Variance Values
- Making Plots of Multiple Fields Simultaneously
- Showing and Hiding Axes Labels and Colorbars
- Accessing and Modifying Plots Directly
- Off-Axis Slicing
- Off-Axis Projection
- Simple Volume Rendering
- Image Background Colors
- Calculating Dataset Information
- A Few Complex Plots
- Multi-Width Image
- Multipanel with Axes Labels
- Time Series Multipanel
- Multi-Plot Slice and Projections
- Advanced Multi-Plot Multi-Panel
- Off-Axis Projection (an alternate method)
- Off-Axis Projection with a Colorbar (an alternate method)
- Thin-Slice Projections
- Plotting Particles Over Fluids
- Plotting Grid Edges Over Fluids
- Overplotting Velocity Vectors
- Overplotting Contours
- Simple Contours in a Slice
- Styling Radial Profile Plots
- Moving a Volume Rendering Camera
- Zooming into an Image
- Opaque Volume Rendering
- Downsampling Data for Volume Rendering
- Volume Rendering with Bounding Box and Overlaid Grids
- Plotting Streamlines
- Plotting Isocontours
- Plotting Isocontours and Streamlines
- Cosmological Analysis
- Constructing Data Objects