galpy.orbit.Orbit.animate¶
- Orbit.animate(**kwargs)[source]¶
Animate a previously calculated orbit.
- Parameters:
d1 (str or callable or list) – First dimension to plot (‘x’, ‘y’, ‘R’, ‘vR’, ‘vT’, ‘z’, ‘vz’, …). Can be a list with up to three entries for three subplots. Each entry can also be an expression like ‘R*vR’ or a user-defined function of time (e.g., lambda t: o.R(t) for R).
d2 (str or callable or list) – Second dimension to plot. Same format as d1.
width (int, optional) – Width of output div in pixels. Default is 600.
height (int, optional) – Height of output div in pixels. Default is 400.
xlabel (str or list, optional) – Label for the first dimension (or list of labels if d1 is a list). Should only have to be specified when using a function as d1 and can then specify as, e.g., [None,’YOUR LABEL’,None] if d1 is a list of three xs and the first and last are standard entries).
ylabel (str or list, optional) – Label for the second dimension. Same format as xlabel.
json_filename (str, optional) – If set, save the data necessary for the figure in this filename (e.g., json_filename= ‘orbit_data/orbit.json’). This path is also used in the output HTML, so needs to be accessible.
staticPlot (bool, optional) – If True, create a static plot that doesn’t allow zooming, panning, etc. Default is False.
ro (float or Quantity, optional) – Physical scale in kpc for distances to use to convert. Default is the object-wide default.
vo (float or Quantity, optional) – Physical scale for velocities in km/s to use to convert. Default is the object-wide default.
use_physical (bool, optional) – Use to override object-wide default for using a physical scale for output.
- Returns:
Object with code to animate the orbit. Can be directly shown in Jupyter notebook or embedded in HTML pages. Get a text version of the HTML using the _repr_html_() function.
- Return type:
IPython.display.HTML
Notes
2017-09-17 - Written - Bovy (UofT)
2019-03-11 - Adapted for multiple orbits - Bovy (UofT)