GetDist Triangle Plot Questions

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Josh Kable
Posts: 6
Joined: March 21 2018
Affiliation: YITP Stony Brook University

GetDist Triangle Plot Questions

Post by Josh Kable » June 25 2019

I am making a triangle plot using GetDist. This triangle plot has two sets of contours which have a lot of overlap (this is good because I am trying to show agreement between the two). I would like to modify two things in the plot:

1) I would like to make one of the contours semi-transparent so that both contours can be seen. I am not sure how to do this using GetDist. I think I am looking for something similar to the Matplotlib 'alpha' parameter.

2) I would like to make the line widths of the contours thinner. There is a triangle plot parameter 'contour_lws', but this seems to only change the 1-D distribution's line widths not the 2-D contour's line widths. Is there a way to make the 2-D contour's line widths thinner?

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: GetDist Triangle Plot Questions

Post by Antony Lewis » June 27 2019

You can change the settings object, e.g. see box 17 in the plot gallery.

Josh Kable
Posts: 6
Joined: March 21 2018
Affiliation: YITP Stony Brook University

Re: GetDist Triangle Plot Questions

Post by Josh Kable » July 11 2019

Thank you for the response. The line_args 'lw' setting seems to only affect the 1-D distributions instead of the contour line widths. Is there something that I am missing? Is there a way to adjust the line widths on the 2-D contours?

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: GetDist Triangle Plot Questions

Post by Antony Lewis » July 12 2019

try changing settings.lw_contour

José Ferreira
Posts: 7
Joined: August 27 2021
Affiliation: Faculdade de Ciências da Universidade de Lisboa

Re: GetDist Triangle Plot Questions

Post by José Ferreira » October 29 2021

I do realize that this is an old thread but since no confirmation by Josh was given, I would like to say that I had a similar issue, I was trying to set a different alpha level for the contours, which can be done as follows:

Code: Select all

g = plots.get_subplot_plotter()
g.settings.alpha_factor_contour_lines=0
I would also like to add, although this is not relevant for this specific thread, why is it that the contours overlap the filled regions of plots which are on top of it, by default? That's the whole reason I'm trying to set a different alpha level for my contour lines.
Here's the output of a corner plot with the default settings, where you can clearly see that the red contour in the 2 sigma region is on top of the filled region in blue which is on top of it, when the red contour should be behind the blue filled region, but still visible due to the alpha level:
Image

Post Reply