Plotting line contours with triangle_plot

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Christina Kreisch
Posts: 4
Joined: July 14 2014
Affiliation: Princeton University

Plotting line contours with triangle_plot

Post by Christina Kreisch » November 04 2018

Hi all,

I am trying to plot contour lines that are not filled in with triangle_plot, but am having a hard time fully accomplishing this. My first attempt was to simply set filled=False, but that raised the error "ValueError: Contour levels must be increasing".

So far I have managed to get the outer contour line to plot and to remove the 2nd level's fill, but not the center fill. Here is what I have so far:

g = plots.getSubplotPlotter(width_inch=12)
g.settings.figure_legend_frame = True
g.settings.tight_layout = True
g.settings.alpha_factor_contour_lines = 1
g.settings.lw_contour = 5
g.settings.alpha_filled_add = 0.25
g.settings.solid_contour_palefactor = 1.0
g.triangle_plot(samples, ['thetastar','clamp','ns'],
filled_compare=True,
filled=False,
line_args=[{'lw':2,'color':'C2','alpha':1},{'lw':2, 'ls':'-', 'color':'C4','alpha':1},{'lw':2, 'color':'C0','alpha':1},{'ls':'-', 'lw':2, 'color':'C3','alpha':1}],
contour_colors=['C2','#9467bd','C0','C3'],
contour_ls = ['-','-','-','-'],
contour_lws = [5,5,5,5])

Any suggestions are much appreciated. Thanks!

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

Re: Plotting line contours with triangle_plot

Post by Antony Lewis » November 04 2018

You should just be able to set filled=False, does the last example in the plot gallery work for you? The error you get sounds like something else.

Christina Kreisch
Posts: 4
Joined: July 14 2014
Affiliation: Princeton University

Re: Plotting line contours with triangle_plot

Post by Christina Kreisch » November 05 2018

It looks like I get the "ValueError: Contour levels must be increasing" error for all of the examples that involve empty contours, like those that start with:

#2D line contour comparison plot with extra bands and markers

#Change the contours levels for marge stats and plots
#(note you need a lot of samples for 99% confidence contours to be accurate)

#3D (scatter) triangle plot

#Add and plot a new derived parameter

#Make plots from chain files, loading automatically as needed

etc.

For reference,
GetDist Version: 0.2.5, Matplotlib version: 2.0.0

Is the issue with my GetDist version?

Thanks!

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

Re: Plotting line contours with triangle_plot

Post by Antony Lewis » November 08 2018

Please do make sure you have the latest getdist before reporting any errors.

Post Reply