cogwheel.gw_plotting.MultiCornerPlot

class cogwheel.gw_plotting.MultiCornerPlot(dataframes, params=None, plotstyles=None, weights_col='weights', labels=None, **plotstyle_kwargs)

Bases: MultiCornerPlot

Has default latex labels for gravitational wave parameters.

Parameters:
dataframessequence of pandas.DataFrame instances, dict

Samples from the distributions to be plotted. If it’s a dict, it should be in the form of {label: samples} pairs, and labels will be read from the keys.

paramslist of str, optional

Subset of columns present in all dataframes, to plot a reduced number of parameters.

plotstylessequence of PlotStyle instances

Determines the colors, linestyles, etc. Must have the same length as dataframes. None (default) makes automatic choices.

weights_colstr, optional

If existing, use a column with this name to set weights for the samples. Pass None to ignore, if you have a column named ‘weights’ that is not to be interpreted as weights.

labelssequence of strings, optional

Legend labels corresponding to the different distributions. Do not pass labels if dataframes is a dict.

**plotstyle_kwargs

Passed to PlotStyle constructor to override defaults. Ignored if plotstyles is passed.

Other Parameters:
confidence_levelfloat between 0 and 1, or None

Determines the reported confidence interval around the median (highlighted band in 1-d marginal probability and numeric values in the subplot titles). If None, both the numerical values and highlighted bands are removed.

contour_fractionssequence of floats

Fractions of the distribution to enclose by 2-d contours.

binsint | {‘rice’, ‘sturges’, ‘sqrt’}

How many histogram bins to use, the same for all parameters.

color_2dstr, RGB tuple, etc.

Color used for the 2-d marginal distributions.

contour_kwargsdict

Keyword arguments to plt.contour and plt.contourf

vline_kwargsdict

Keyword arguments to plt.plot for the vertical lines signaling medians and 1-d confidence intervals.

vfill_kwargsdict

Keyword arguments to plt.fill_between for 1-d plots.

kwargs_1ddict

Keyword arguments to plt.plot for 1-d plots.

clabel_kwargsdict, optional

Keyword arguments for contour labels. Pass an empty dict to use defaults. None draws no contour labels.

fill{‘gradient’, ‘flat’, ‘none’}

How to display 2-d marginal distributions:

  • ‘gradient’ shows the 2-d pdf with a transparency gradient

  • ‘flat’ fills the contours with a flat transparent color

  • ‘none’ shows just the contours

smoothfloat

Smooth the 2d histograms by convolving them with a Gaussian kernel with this standard deviation in pixel units. 0 (default) does no smoothing.

densitybool

Whether to normalize the 1-d histograms to integrate to 1.

tail_probabilityfloat between 0 and 1

Disregard tail_probability / 2 of the distribution to either side in the plots. Used as an automatic way of zooming in on the interesting part of the distribution if there are a few outlier samples. 0 (default) includes all samples.

Methods

plot

Make a corner plot with all distributions overlaid.

plot_2d

Plot just one panel of the corner plot.

corner_plot_cls

alias of CornerPlot

plot(max_figsize=10.0, max_n_ticks=4, title=None, legend_title=None)

Make a corner plot with all distributions overlaid.

Parameters:
max_figsizefloat

Maximum size in inches of a side of the square figure.

max_n_ticksint

Determines the number of ticks in each subplot.

titlestr, optional

Figure title.

legend_titlestr, optional

Legend title.

plot_2d(xpar, ypar, ax=None)

Plot just one panel of the corner plot.

Parameters:
xpar, yparstr

Parameters in self.params to plot in the x and y axes.

axmatplotlib.axes.Axes or None

Axes on which to draw the figure. None makes new axes.