Page 1 of 1

Priority and overlap on filled contours with Getdist

Posted: July 11 2020
by Dournac Fabien

currently, I generate a triplot with 2 covariance matrixes where I have this kind of subplot :


As you can see, there is a almost totally masked red zone area (not shaded red) by the blue zone (shaded blue + true blue).

The blue zone seems to have priority in the drawing of contours whereas I would like that true red filled disk not te masked by the blue shaded zone (Nevertheless, I want the blue contours not be affected and keep their displaying).

How to change this priority in the overlapping of different area, especially when one wants to draw/put a 1 sigma filled contour of plain color over a 2 sigma shaded filled contour knowing the 1 sigma filled contour is smaller (plain red masked in my case) than the 2 shaded filled contour (blue shaded) ?

Code: Select all

# Call triplot
g.triangle_plot([matrix1, matrix2],
                filled = True,
                legend_labels = ['Red contours - Surface of 2 sigma bigger, 'Blue ccontours - Surface of 2 sigma smaller'],
                legend_loc = 'upper right',
                contour_colors = ['red','darkblue'],
                line_args = [{'lw':2, 'color':'red'},
                {'lw':2, 'color':'darkblue'}],
Here below an example where the 2 plain - 1 sigma contours red and blue are drawing (without affecting the contours). Don't take into accounf of yellow contours.


On this image, you can see clearly that both (1 sigma blue and red filled disk) are drawing with true red and blue colors (I mean not shaded).

Is it possible to do the same with some options of GetDist (in my case) ?


Re: Priority and overlap on filled contours with Getdist

Posted: July 13 2020
by Antony Lewis
You can maybe get it by playing with the alpha parameters, not sure

Re: Priority and overlap on filled contours with Getdist

Posted: July 14 2020
by Dournac Fabien
Hi Antony,

I have already tried to play with alpha_filled_add parameter but the original colors of legend don't correspond anymore to the colors present in the contours (there is a mix of both colors, here red and darkblue). Here below different illustrations by taking successively :

alpha_filled_add = 0.0
alpha_filled_add = 0.5
alpha_filled_add = 1.0

Image : darkblue contours filled disappeared

Image : problem here as I said above is that darkblue filled contour is mixing with red contours, which then produce purple contours : this is not I would like to get since colors mixed don't correspond anymore to the color in the legend (red and darkblue). The solution would be to get the same triplot but with colors of legend (no mixing).

Image : current version. It illustrates my original post : the box representing the joint distribution $h$ vs $\sigma_8$ is masking the red 1 sigma filled contour by the shaded 2 sigma blue filled ellipse and set all in front of the plane the darkblue (plain and shaded) color.

So, as conclusion, I don't know what to do.

That's why I need to know the routine to modify in GetDist sources to overcome this issue of priority in the drawing of 1 sigma contour while keeping contours not modified.

Any remark is welcome !