Page 1 of 1

Plot only 1 sigma or 2 sigma contours

Posted: August 01 2020
by Dournac Fabien
Hello,

In a context of covariane matrix with Fisher's formism, I would like to plot, with triangle_plot function only 1 sigma contour or 2 sigma contours, not the both in the same time.

Here is below my current code snippet that plots 1 and 2 sigma at the same time of 2 covariance matrixes (matrix1 and matrix 2) :

Code: Select all

# Call triplot
g.triangle_plot([matrix1, matrix2],
                names,
                filled = True,
                legend_labels = ['1240', '1565'],
                legend_loc = 'upper right',
                contour_colors = ['red','darkblue'],
                line_args = [{'lw':2, 'color':'red'},
                {'lw':2, 'color':'darkblue'}],
                )
I saw during my researches a paramater called contour_levels for example in the function add_2d_contours but I don't know how to use it
in triangle_plot for plotting only 1 or 2 sigma contours.

If anyone could help, this would be fine.

Re: Plot only 1 sigma or 2 sigma contours

Posted: August 03 2020
by Antony Lewis
You can set "contours" in analysis settings to determine which contours are calculated (and then numbered 0, 1,2.. in getdist plotting):

https://getdist.readthedocs.io/en/latest/analysis_settings.html?highlight=analysis%20settings

"num_plot_contours" in the plot settings determines which are actually plotted

https://getdist.readthedocs.io/en/latest/plots.html#getdist.plots.GetDistPlotSettings

Re: Plot only 1 sigma or 2 sigma contours

Posted: August 21 2020
by Dournac Fabien
You can set "contours" in analysis settings to determine which contours are calculated (and then numbered 0, 1,2.. in getdist plotting):

https://getdist.readthedocs.io/en/latest/analysis_settings.html?highlight=analysis%20settings

"num_plot_contours" in the plot settings determines which are actually plotted

https://getdist.readthedocs.io/en/latest/plots.html#getdist.plots.GetDistPlotSettings
Dear Antony, I think that it may be the trick to apply.

Do you think that if I can call several times the function triangle_plot respecting an order in the image rendering (one covariance matrix per each call), i.e I mean for example, the first call is the lower z-index which would correspond to the highest size of ellipse , the second one to a lower size of ellipse, and so on up to the smallest ellipse, therefore it would allow me to set a priority like I describe it in my last post viewtopic.php?f=11&t=3392 ?

Indeed, in this recent post, I already talk about the possibility to call several times the function triangle_plot and how to overlap the contours this way.

Regards