# How to plot 68% contours?

I am doing a grid search of omega_Matter vs Omega_dark_energy by iterating over ranges of both and determining the chi-squared to determine the optimal value of both for a LambdaCDM model. I have my grid of omegaM and OmegaDE but I am trying to plot contours at a 68% confidence level and am at a bit of a loss at how to go about doing this.

I am using matplotlib to generate an NxN grid to which the axes correspond to omegaM and omegaDe values and the coordinate points on the grid correspond to the chi-squared of those values. I am then trying to plot a contour plot around the minimum chi-squared value. For now i am using plt.contourf but this doesn't generate specifically 68% confidence contours and therefore I was wondering if there was a specific package in python that did this.

Any help/advice would be greatly appreciated.

• What program are you using? Please specify so unfamiliar users can understand. Oct 25, 2021 at 16:00
• Yes my apologies I have been a little scarce on the details. I am using matplotlib to generate an NxN grid to which the axes correspond to omegaM and omegaDe values and the coordinate points on the grid correspond to the chi-squared of those values. I am then trying to plot a contour plot around the minimum chi-squared value. For now i am using plt.contourf but this doesn't generate specifically 68% confidence contours and therefore I was wondering if there was a specific package in python that did this. Hope that makes some more sense. Thank you!
– r21
Oct 25, 2021 at 16:09
• Thanks! I've edited your comment into the post. Oct 25, 2021 at 16:28
• Ah thank you so much!
– r21
Oct 25, 2021 at 16:29
• Thank you for looking into that for me, I completely missed that part of the documentation! I will have a look now. Thanks again for your help.
– r21
Oct 26, 2021 at 8:46

Essentially, in case of a map of 2 parameters, your $$\Delta S = S - S_\mathrm{min}$$ statistic follows a $$\chi²$$ distribution with 2 free parameters. So we want to know how high we have to go in $$\Delta S$$ to include 68% of this distribution. And if you look that up from the cumulative distribution function: So in conclusiion you will get the 1-sigma contour, if you draw you contours at $$S_\mathrm{min} + 2.30$$.