Plots

Contents

Plots#

The following are built-in plotting functions using matplotlib and seaborn.

stelpar.plot.corner_plot(chains, savefile=None, show=True, nsamples=None, contour_fill_kws=None, contour_outline_kws=None, diag_kws=None, grid_kws=None, show_titles=False, title_fmt='.2f', title_kws=None)[source]#

Creates a corner plot showing smoothed histograms and 2D contours of the stellar parameters.

Parameters:
  • chains (DataFrame) – Contains the posterior distributions from which the corner plot will be made.

  • savefile (str, optional) – The file location to save the figure. If None (default), will not save the figure.

  • show (bool, optional) – If True (default), displays the figure.

  • nsamples (int, optional) – The number of random samples to draw from the chains to make the plots. If None, will use the full chains. The default is None.

  • show_titles (bool, optional) – Whether to show titles above each diagonal controlled by title_{fmt, kws}. The default is False

  • title_fmt (str, optional) – Format the title strings of the diagonal axes. Default is ‘.2f’.

  • title_kws (dict, optional) – Additional keyword arguments to pass to each title of the diagonal axes. Default is None.

  • **customization_kwargs (dict, optional) –

    Additional keyword arguments used to change the style of the figure. See seaborn.pairplot and seaborn.PairGrid for more information. The difference is here plot_kws is broken into “fill” and “outline” keywords for more customization. The defaults are None.

    Options include:
    • contour_fill_kwsdict

      Controls the 2D contour fill. If None, uses dict(fill=True, color=’gray’, levels=4, cut=0).

    • contour_outline_kwsdict

      Controls the 2D contour outline. If None, uses dict(fill=False, color=’black’, levels=4, linewidths=3, cut=0).

    • diag_kwsdict

      Controls the 1D histograms at the diagonal. If None, uses dict(fill=True, color=’gray’, edgecolor=’black’, linewidth=3, cut=0).

    • grid_kwsdict

      Controls the overall grid of plots. If None, uses dict(corner=True, diag_sharey=False).

Returns:

gridseaborn.PairGrid object which contains the plot elements.

Return type:

PairGrid