For a 2D Gaussian state estimate with covariance P, the confidence ellipse is aligned with the eigenvectors of P.
The semi-axis lengths are the square roots of the eigenvalues, scaled by a chi-square factor for the desired confidence level.
For example:
1-sigma (39.35%) → multiply by 1
95% confidence → multiply by √5.991 ≈ 2.4477
The direction of the ellipse is given by the eigenvectors of P, and the center is the mean vector μ.
For more details and worked examples for 1-D confidence interval, see:
The complete method for computing 2-D confidence ellipses, including MATLAB and Python code, is covered in the book "Kalman Filter from the Ground Up."