galaxychop.plot module
Plot helper for the galaxy object.
- class galaxychop.plot.GalaxyPlotter(galaxy)[source]
Bases:
objectMake plots of DecisionMatrix.
- get_df_and_hue(ptypes, attributes, labels, lmap)[source]
Dataframe and Hue constructor for plot implementations.
- Parameters
ptypes (keys of
ParticleSet classparameters.) – Particle type.attributes (keys of
ParticleSet classparameters.) – Names ofParticleSet classparameters.labels (keys of
ParticleSet classparameters.) – Variable to map plot aspects to different colors.lmap (dicts) – Name assignment to the label.
- Returns
df (pandas.DataFrame) – DataFrame of galaxy properties with labels added.
hue (keys of
ParticleSet classparameters.) – Labels of all galaxy particles.
- pairplot(ptypes=None, attributes=None, labels='ptype', lmap=None, **kwargs)[source]
Draw a pairplot of the galaxy properties.
By default, this function will create a grid of Axes such that each numeric variable in data will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots drow a univariate distribution to show the marginal distribution of the data in each column. This function groups the values of all galaxy particles according to some
ParticleSet classparameter.- Parameters
ptypes (keys of
ParticleSet classparameters.) – Particle type. Default value = Noneattributes (keys of
ParticleSet classparameters.) – Names ofParticleSet classparameters. Default value = Nonelabels (keys of
ParticleSet classparameters.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.pairplot.
- Returns
- Return type
seaborn.axisgrid.PairGrid
- scatter(x, y, ptypes=None, labels=None, lmap=None, **kwargs)[source]
Draw a scatter plot of galaxy properties.
Shows the relationship between x and y. This function groups the values of all galaxy particles according to some
ParticleSet classparameter.- Parameters
x (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.ptypes (keys of
ParticleSet classparameters.) – Particle type. Default value = Nonelabels (keys of
ParticleSet classparameters.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.scatterplot.
- Returns
- Return type
matplotlib.axes.Axes
- hist(x, y=None, ptypes=None, labels=None, lmap=None, **kwargs)[source]
Draw a histogram of galaxy properties.
Plot univariate or bivariate histograms to show distributions of datasets. This function groups the values of all galaxy particles according to some
ParticleSet classparameter.- Parameters
x (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.ptypes (keys of
ParticleSet classparameters.) – Particle type. Default value = Nonelabels (keys of
ParticleSet classparameters.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.histplot.
- Returns
- Return type
matplotlib.axes.Axes
- kde(x, y=None, ptypes=None, labels=None, lmap=None, **kwargs)[source]
Draw a Kernel Density plot of galaxy properties.
Plot univariate or bivariate distributions using kernel density estimation (KDE). This plot represents the galaxy properties using a continuous probability density curve in one or more dimensions. This function groups the values of all galaxy particles according to some
ParticleSet classparameter.- Parameters
x (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
ParticleSet classparameters.) – Variables that specify positions on the x and y axes. Default value y = None.ptypes (keys of
ParticleSet classparameters.) – Particle type. Default value = Nonelabels (keys of
ParticleSet classparameters.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.kdeplot.
- Returns
- Return type
matplotlib.axes.Axes
- get_circ_df_and_hue(cbins, attributes, labels, lmap)[source]
Dataframe and Hue constructor for plot implementations.
- Parameters
cbins (tuple) – It contains the two widths of bins necessary for the calculation of the circular angular momentum. Shape: (2,). Dafult value = (0.05, 0.005).
attributes (keys of
JCirctuple.) – Keys of the normalized specific energy, the circularity parameter (J_z/J_circ) and/or the projected circularity parameter (J_p/J_circ) of the stellar particles.labels (keys of
JCirctuple.) – Variable to map plot aspects to different colors.lmap (dicts) – Name assignment to the label.
- Returns
df (pandas.DataFrame) – DataFrame of the normalized specific energy, the circularity parameter (J_z/J_circ) and/or the projected circularity parameter (J_p/J_circ) of the stellar particles with labels added.
hue (keys of
JCirctuple.) – Labels of stellar particles.
- circ_pairplot(cbins=(0.05, 0.005), attributes=None, labels=None, lmap=None, **kwargs)[source]
Draw a pairplot of circularity and normalized energy.
By default, this function will create a grid of Axes such that each numeric variable in data will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots drow a univariate distribution to show the marginal distribution of the data in each column. This function groups the values of stellar particles according to some keys of
JCirctuple.- Parameters
cbins (tuple) – It contains the two widths of bins necessary for the calculation of the circular angular momentum. Shape: (2,). Dafult value = (0.05, 0.005).
attributes (keys of
ParticleSet classparameters.) – Names ofParticleSet classparameters. Default value = Nonelabels (keys of
JCirctuple.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.pairplot.
- Returns
- Return type
seaborn.axisgrid.PairGrid
- circ_scatter(x, y, cbins=(0.05, 0.005), labels=None, lmap=None, **kwargs)[source]
Draw a scatter plot of circularity and normalized energy.
Shows the relationship between x and y. This function groups the values of stellar particles according to some keys of
JCirctuple.- Parameters
x (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.cbins (tuple) – It contains the two widths of bins necessary for the calculation of the circular angular momentum. Shape: (2,). Dafult value = (0.05, 0.005).
labels (keys of
JCirctuple.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.scatterplot.
- Returns
- Return type
matplotlib.axes.Axes
- circ_hist(x, y=None, cbins=(0.05, 0.005), labels=None, lmap=None, **kwargs)[source]
Draw a histogram of circularity and normalized energy.
Plot univariate or bivariate histograms to show distributions of datasets. This function groups the values of stellar particles according to some keys of
JCirctuple.- Parameters
x (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.cbins (tuple) – It contains the two widths of bins necessary for the calculation of the circular angular momentum. Shape: (2,). Dafult value = (0.05, 0.005).
labels (keys of
JCirctuple.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.histplot.
- Returns
- Return type
matplotlib.axes.Axes
- circ_kde(x, y=None, cbins=(0.05, 0.005), labels=None, lmap=None, **kwargs)[source]
Draw a Kernel Density plot of circularity and normalized energy.
Plot univariate or bivariate distributions using kernel density estimation (KDE). This plot represents normalized specific energy, the circularity parameter (J_z/J_circ) and/or the projected circularity parameter (J_p/J_circ) of the stellar particles using a continuous probability density curve in one or more dimensions. This function groups the values of stellar particles according to some keys of
JCirctuple.- Parameters
x (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.y (keys of
JCirctuple.) – Variables that specify positions on the x and y axes. Default value y = None.cbins (tuple) – It contains the two widths of bins necessary for the calculation of the circular angular momentum. Shape: (2,). Dafult value = (0.05, 0.005).
labels (keys of
JCirctuple.) – Variable to map plot aspects to different colors. Default value = Nonelmap (dicts) – Name assignment to the label. Default value = None
**kwargs – Additional keyword arguments are passed and are documented in
seaborn.kdeplot.
- Returns
- Return type
matplotlib.axes.Axes