Plots#

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

stelpar.plot.mag_v_wavelength_eyecheck(photometry, name=None, savefile=None, show=True)[source]#

Creates a plot of absolute magnitude vs. wavelength.

Parameters:
  • photometry (DataFrame) – The measured and estimated magnitudes and other photometric data.

  • 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.

Returns:

figmatplotlib.figure.Figure object which contains the plot elements.

Return type:

Figure

stelpar.plot.flux_v_wavelength(photometry, title=None, singlefig=True, savefile=None, show=True)[source]#

Creates a plot of flux density vs. wavelength.

Parameters:
  • photometry (DataFrame) – The measured and estimated magnitudes and other photometric data.

  • title (str, optional) – The figure title. The defult is None.

  • singlefig (bool, optional) – If True (default), presents the figure with one plot containing median and max-likelihood values. Otherwise, separates those values to different subplots in the figure.

  • 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.

Returns:

figmatplotlib.figure.Figure object which contains the plot elements.

Return type:

Figure

stelpar.plot.corner_plot(chains, savefile=None, show=True, nsamples=None, show_titles=False, title_fmt='.2f', title_kws=None, levels=4, fill=True, fillcolor='gray', edgecolor='black', linewidths=3, cut=0, bw_adjust=1, contour_fill_kws=None, contour_outline_kws=None, diag_kws=None, grid_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

stelpar.plot.time_series(samples, savefile=None, show=True, alpha=0.4)[source]#

Makes a time-series plot of the fit parameters’ positions.

Parameters:
  • samples (array) – The 3D chain of fit parameter posteriors.

  • 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.

Returns:

figmatplotlib.figure.Figure object which contains the plot elements.

Return type:

Figure