- RIFT.misc.our_corner.corner(xs, bins=20, range=None, weights=None, color='k', smooth=None, smooth1d=None, no_1d=True, labels=None, label_kwargs=None, show_titles=False, title_fmt='.2f', title_kwargs=None, truths=None, truth_color='#4682b4', scale_hist=False, quantiles=None, verbose=False, fig=None, max_n_ticks=5, top_ticks=False, use_math_text=False, reverse=False, hist_kwargs=None, **hist2d_kwargs)
Make a sick corner plot showing the projections of a data set in a multi-dimensional space. kwargs are passed to hist2d() or used for matplotlib styling. Parameters ———- xs : array_like[nsamples, ndim]
The samples. This should be a 1- or 2-dimensional array. For a 1-D array this results in a simple histogram. For a 2-D array, the zeroth axis is the list of samples and the next axis are the dimensions of the space.
- binsint or array_like[ndim,]
The number of bins to use in histograms, either as a fixed value for all dimensions, or as a list of integers for each dimension.
- weightsarray_like[nsamples,]
The weight of each sample. If None (default), samples are given equal weight.
- colorstr
A
matplotlibstyle color for all histograms.- smooth, smooth1dfloat
The standard deviation for Gaussian kernel passed to scipy.ndimage.gaussian_filter to smooth the 2-D and 1-D histograms respectively. If None (default), no smoothing is applied.
- labelsiterable (ndim,)
A list of names for the dimensions. If a
xsis apandas.DataFrame, labels will default to column names.- label_kwargsdict
Any extra keyword arguments to send to the set_xlabel and set_ylabel methods.
- show_titlesbool
Displays a title above each 1-D histogram showing the 0.5 quantile with the upper and lower errors supplied by the quantiles argument.
- title_fmtstring
The format string for the quantiles given in titles. If you explicitly set
show_titles=Trueandtitle_fmt=None, the labels will be shown as the titles. (default:.2f)- title_kwargsdict
Any extra keyword arguments to send to the set_title command.
- rangeiterable (ndim,)
A list where each element is either a length 2 tuple containing lower and upper bounds or a float in range (0., 1.) giving the fraction of samples to include in bounds, e.g., [(0.,10.), (1.,5), 0.999, etc.]. If a fraction, the bounds are chosen to be equal-tailed.
- truthsiterable (ndim,)
A list of reference values to indicate on the plots. Individual values can be omitted by using
None.- truth_colorstr
A
matplotlibstyle color for thetruthsmakers.- scale_histbool
Should the 1-D histograms be scaled in such a way that the zero line is visible?
- quantilesiterable
A list of fractional quantiles to show on the 1-D histograms as vertical dashed lines.
- verbosebool
If true, print the values of the computed quantiles.
- plot_contoursbool
Draw contours for dense regions of the plot.
- use_math_textbool
If true, then axis tick labels for very large or small exponents will be displayed as powers of 10 rather than using e.
- reversebool
If true, plot the corner plot starting in the upper-right corner instead of the usual bottom-left corner
- max_n_ticks: int
Maximum number of ticks to try to use
- top_ticksbool
If true, label the top ticks of each axis
- figmatplotlib.Figure
Overplot onto the provided figure object.
- hist_kwargsdict
Any extra keyword arguments to send to the 1-D histogram plots.
- **hist2d_kwargs
Any remaining keyword arguments are sent to corner.hist2d to generate the 2-D histogram plots.
- RIFT.misc.our_corner.hist2d(x, y, bins=20, range=None, weights=None, levels=None, smooth=None, ax=None, color=None, plot_datapoints=True, plot_density=True, plot_contours=True, no_fill_contours=False, fill_contours=False, contour_kwargs=None, contourf_kwargs=None, data_kwargs=None, **kwargs)
Plot a 2-D histogram of samples. Parameters ———- x : array_like[nsamples,]
The samples.
- yarray_like[nsamples,]
The samples.
- levelsarray_like
The contour levels to draw.
- axmatplotlib.Axes
A axes instance on which to add the 2-D histogram.
- plot_datapointsbool
Draw the individual data points.
- plot_densitybool
Draw the density colormap.
- plot_contoursbool
Draw the contours.
- no_fill_contoursbool
Add no filling at all to the contours (unlike setting
fill_contours=False, which still adds a white fill at the densest points).- fill_contoursbool
Fill the contours.
- contour_kwargsdict
Any additional keyword arguments to pass to the contour method.
- contourf_kwargsdict
Any additional keyword arguments to pass to the contourf method.
- data_kwargsdict
Any additional keyword arguments to pass to the plot method when adding the individual data points.
- RIFT.misc.our_corner.quantile(x, q, weights=None)
Compute sample quantiles with support for weighted samples. Note —- When
weightsisNone, this method simply calls numpy’s percentile function with the values ofqmultiplied by 100. Parameters ———- x : array_like[nsamples,]The samples.
- qarray_like[nquantiles,]
The list of quantiles to compute. These should all be in the range
[0, 1].- weightsOptional[array_like[nsamples,]]
An optional weight corresponding to each sample. These
Returns
- quantilesarray_like[nquantiles,]
The sample quantiles computed at
q.
Raises
- ValueError
For invalid quantiles;
qnot in[0, 1]or dimension mismatch betweenxandweights.