Plotting line contours with triangle_plot
Posted: 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!
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!