plot_scatter()#
- liesel.goose.plot_scatter(results, params, param_indices, chain_indices=None, max_chains=5, alpha=0.2, title=None, title_spacing=0.9, style='whitegrid', color_list=None, figure_size=(9, 6), legend_position='best', save_path=None, include_warmup=False, show=True)[source]#
Produces a scatterplot of two parameters.
- Parameters:
results (
SamplingResults|dict[str,Any]) – Result object of the sampling process. Must have a methodget_posterior_samples()which extracts all samples from the posterior distribution. Alternatively, you can directly supply a dictionary of samples, for example the output ofSamplingResults.get_posterior_samples().params (
list[str]) – Names of the model parameters that are contained in the plot. Must coincide with the dictionary keys of thePositionwith the posterior samples.param_indices (
tuple[int,int]) – Indices of each model parameter that are contained in the plot. Selects e.g.beta[0]out of abetaparameter vector. If only one string is supplied as the value ofparams,param_indicesmust contain two indices. If a sequence of two strings is supplied toparams, you can supply either a single integer or a tuple of two integers. A single integer will be used as the index for both parameters. If you use a tuple of two integers, the first element will be used as the index for the first parameter, and the second element will be used as the index for the second parameter.chain_indices (
int|Sequence[int] |None, default:None) – Indices of chains for each model subparameter that are contained in the plot. Selects e.g. chain 0 and chain 2 out of multiple chains. A single index can be specified as an integer or a sequence containing one integer. IfNone, all chains are included.max_chains (
int|None, default:5) – Upper bound how many chains are included within each subplot/facet. Avoids overplotting. IfNone, all chains contained in theresultsinput are plotted. Always starts chain selection from the lowest chain index upwards. For selecting specific chains use the argumentchain_indices.alpha (
float, default:0.2) – Amount of transparency; a float between 0 and 1.title_spacing (
float, default:0.9) – Determines the margin/whitespace between the plot title (set withfig.suptitle()) and the first row of subplots/facets. Passed to thetopargument offig.subplots_adjust().style (
str, default:'whitegrid') – Passed to thestyleargument ofsns.set_theme(). Valid options aredarkgrid,whitegrid,dark,white, andticks.color_list (
list[str] |None, default:None) – Determines the chain colors for all three subplots. Custom colors can be passed with a list of color strings. The length of the list must match the number of chains. IfNone, the defaulttab10matplotlib colormap is chosen.figure_size (
tuple[int|float,int|float], default:(9, 6)) – Size of the entire plot grid. Passed to thefigsizeargument ofplt.figure(). When changing the figure size consider changing thelegend_positionas well. Generally, a ratio of 3legend_position (
tuple[float,float] |str, default:'best') – Determines the color legend position. Coordinates are relative to the upper panel within the plot grid. The first coordinate specifies the horizontal, the second coordinate the vertical position. Might require an adjustment when changing thefigure_sizevalues or the number of chains.save_path (
str|None, default:None) – File path where the plot is saved.