yt.visualization.profile_plotter.ProfilePlot.from_profiles

classmethod ProfilePlot.from_profiles(profiles, labels=None, plot_specs=None, y_log=None)[source]

Instantiate a ProfilePlot object from a list of profiles created with create_profile().

Parameters:

profiles : a profile or list of profiles

A single profile or list of profile objects created with create_profile().

labels : list of strings

A list of labels for each profile to be overplotted. Default: None.

plot_specs : list of dicts

A list of dictionaries containing plot keyword arguments. For example, [dict(color=”red”, linestyle=”:”)]. Default: None.

Examples

>>> from yt import simulation
>>> es = simulation("AMRCosmology.enzo", "Enzo")
>>> es.get_time_series()
>>> profiles = []
>>> labels = []
>>> plot_specs = []
>>> for ds in es[-4:]:
...     ad = ds.all_data()
...     profiles.append(create_profile(ad, ["Density"],
...                                    fields=["Temperature",
...                                            "x-velocity"]))
...     labels.append(ds.current_redshift)
...     plot_specs.append(dict(linestyle="--", alpha=0.7))
>>>
>>> plot = ProfilePlot.from_profiles(profiles, labels=labels,
...                                  plot_specs=plot_specs)
>>> plot.save()