Skip to content

Note

Click here to download the full example code

Blinding Plots

You can blind parameters and not show axis labels very easily!

Just give ChainConsumer the blind parameter when plotting. You can specify True to blind all parameters, or give it a string (or list of strings) detailing the specific parameters you want blinded!

from chainconsumer import Chain, ChainConsumer, PlotConfig, make_sample

df = make_sample(num_dimensions=4, seed=1)
c = ChainConsumer()
c.add_chain(Chain(samples=df, name="Blind Me!"))
c.set_plot_config(PlotConfig(blind=["A", "B"]))
fig = c.plotter.plot()

$C = 10.0\pm 1.0$, $D = 15.01^{+1.00}_{-1.02}$

Notice the blinding applies to all plots

fig = c.plotter.plot_summary()

A, B, C, D

fig = c.plotter.plot_walks()

plot 1 blinding

fig = c.plotter.plot_distributions()

$C = 10.0\pm 1.0$, $D = 15.01^{+1.00}_{-1.02}$

And the LaTeX output

print(c.analysis.get_latex_table())

Out:

\begin{table}
    \centering
    \caption{}
    \label{tab:model_params}
    \begin{tabular}{ccc}
        \hline
                Model & C & D \\ 
                \hline
                Blind Me! & $10.0\pm 1.0$ & $15.01^{+1.00}_{-1.02}$ \\ 
                \hline
    \end{tabular}
\end{table}

Total running time of the script: ( 0 minutes 8.809 seconds)

Download Python source code: plot_1_blinding.py

Download Jupyter notebook: plot_1_blinding.ipynb

Gallery generated by mkdocs-gallery