sage_analysis.example_plots

Here we show a myriad of functions that can be used to plot properties calculated from the SAGE output.

We refer to ../user/plot for more information on how plotting is handled.

Authors: (Jacob Seiler, Manodeep Sinha)

sage_analysis.example_plots.plot_BMF(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the baryonic mass function for the specified models. This is the mass function for the stellar mass + cold gas.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the baryonic mass function of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>2.BaryonicMassFunction.<output_format>”

sage_analysis.example_plots.plot_BTF(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the baryonic Tully-Fisher relationship for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the baryonic Tully-Fisher relationship of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>4.BaryonicTullyFisher.<output_format>”

sage_analysis.example_plots.plot_GMF(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the gas mass function for the specified models. This is the mass function for the cold gas.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the gas mass function of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>3.GasMassFunction.<output_format>”

sage_analysis.example_plots.plot_SFRD_history(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the evolution of star formation rate density for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].
  • snapshots (nested list of ints) – This is a dummy variable that is present to ensure the signature is identical to the other plot functions.
  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.
  • Generates
  • ———
  • The plot will be saved as “<output_path>B.SFRDensity.<output_format>”
sage_analysis.example_plots.plot_SMD_history(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the evolution of stellar mass density for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].
  • snapshots (nested list of ints) – This is a dummy variable that is present to ensure the signature is identical to the other plot functions.
  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.
  • Generates
  • ———
  • The plot will be saved as “<output_path>C.StellarMassDensity.<output_format>”
sage_analysis.example_plots.plot_SMF(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper, plot_sub_populations: bool = False) → matplotlib.figure.Figure[source]

Plots the stellar mass function for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the stellar mass function of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • plot_sub_populations (Boolean, default False) – If True, plots the stellar mass function for red and blue sub-populations.

  • Generates

  • ———

  • The plot will be saved as “<output_path>1.StellarMassFunction.<output_format>”

sage_analysis.example_plots.plot_SMF_history(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the evolution of the stellar mass function for the specified models. This function loops over the value of model.SMF_snaps and plots and the SMFs at each snapshots.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].
  • snapshots (nested list of ints) – This is a dummy variable that is present to ensure the signature is identical to the other plot functions.
  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.
  • Generates
  • ———
  • The plot will be saved as “<output_path>A.StellarMassFunction.<output_format>”
sage_analysis.example_plots.plot_baryon_fraction(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper, plot_sub_populations: bool = False) → matplotlib.figure.Figure[source]

Plots the total baryon fraction as afunction of halo mass for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the baryon fraction of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • plot_sub_populations (Boolean, default False) – If True, plots the baryon fraction for each reservoir. Otherwise, only plots the total baryon fraction.

  • Generates

  • ———

  • The plot will be saved as “<output_path>11.BaryonFraction.<output_format>”

sage_analysis.example_plots.plot_bh_bulge(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the black-hole bulge relationship for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the black hole bulge relationship of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>8.BlackHoleBulgeRelationship.<output_format>”

sage_analysis.example_plots.plot_bulge_fraction(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper, plot_disk_fraction: bool = False, plot_var: bool = False) → matplotlib.figure.Figure[source]

Plots the fraction of the stellar mass that is located in the bulge/disk as a function of stellar mass for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the bulge fraction of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • plot_disk_fraction (bool, optional) – If specified, will also plot the disk fraction.

  • plot_var (Boolean, default False) – If True, plots the variance as shaded regions.

  • Generates

  • ———

  • The plot will be saved as :py:attr:`~sage_analysis.plot_helper.PlotHelper.output_path`10.BulgeMassFraction.

  • :py:attr:`~sage_analysis.plot_helper.PlotHelper.output_format`.

sage_analysis.example_plots.plot_gas_fraction(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the fraction of baryons that are in the cold gas reservoir as a function of stellar mass for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the gas fraction of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>6.GasFraction.<output_format>”

sage_analysis.example_plots.plot_metallicity(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the metallicity as a function of stellar mass for the speicifed models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the metallicity of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>7.Metallicity.<output_format>”

sage_analysis.example_plots.plot_quiescent(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper, plot_sub_populations: bool = False) → matplotlib.figure.Figure[source]

Plots the fraction of galaxies that are quiescent as a function of stellar mass for the specified models. The quiescent cut is defined by sSFRcut.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the quiescent fraction of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • plot_sub_populations (Boolean, default False) – If True, plots the centrals and satellite sub-populations.

  • Generates

  • ———

  • The plot will be saved as “<output_path>9.QuiescentFraction.<output_format>”

sage_analysis.example_plots.plot_reservoirs(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → List[matplotlib.figure.Figure][source]

Plots the mass in each reservoir as a function of halo mass for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, each snapshot will be plotted and saved as a separate figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • A plot will be saved as ``”<output_path>12.MassReservoirs<model.label>.<output_format>”`` for each mode.

sage_analysis.example_plots.plot_sSFR(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the specific star formation rate as a function of stellar mass for the specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the specific star formation rate of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • The plot will be saved as “<output_path>5.SpecificStarFormationRate.<output_format>”

sage_analysis.example_plots.plot_spatial(models: List[sage_analysis.model.Model], snapshots: List[List[int]], plot_helper: sage_analysis.plot_helper.PlotHelper) → matplotlib.figure.Figure[source]

Plots the spatial distribution of the galaxies for specified models.

Parameters:
  • models (List of Model class instance) – Models that will be plotted. These instances contain the properties necessary to create the plot, accessed via Model.properties["snapshot_<snapshot>"]["property_name"].

  • snapshots (nested list of ints) – The snapshots to be plotted for each Model in models.

    The length of the outer list MUST be equal to the length of models. For each model, the spatial position of all snapshots are plotted on the figure.

  • plot_helper (PlotHelper) – A helper class that contains attributes and methods to assist with plotting. In particular, the path where the plots will be saved and the output format. Refer to ../user/plot_helper for more information on how to initialize this class and its use.

  • Generates

  • ———

  • A plot will be saved as ``”<output_path>13.SpatialDistribution<model.label>.<output_format>”`` for each

  • model.

sage_analysis.example_plots.plot_spatial_3d(pos, output_file, box_size) → matplotlib.figure.Figure[source]

Plots the 3D spatial distribution of galaxies.

Parameters:
  • pos (numpy 3D array with length equal to the number of galaxies) – The position (in Mpc/h) of the galaxies.
  • output_file (String) – Name of the file the plot will be saved as.
Returns:

Return type:

None. A plot will be saved as output_file.