Hello,
I am trying to do a g.triangle plot with 1
[math]\sigma C.L represented by a filled disk and 2
[math]\sigma C.L represented by
just contours (without being filled).
Below an example of what I would like to do :
How to achieve this ?
My starting script is :
Code: Select all
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = True
g.settings.legend_fontsize = 24
g.settings.axes_labelsize = 24
g.settings.axes_fontsize = 20
g.settings.alpha_filled_add = 0.9
g.settings.title_limit_fontsize = 1
g.triangle_plot([matrix1, matrix2],
names,
filled = True,
legend_labels = ['File1', 'File2'],
contour_colors = ['blue','red']
)
and the corresponding figure :
As you can see, every confidence levels are represented by filled disks : I just want to have for each paramter a filled disk at CL=1sigma and a contours (without filling) for 2 sigma.
Is it possible ? I tried to apply differents options but without success.
Hello,
I made progress from the previous post above.
I can zoom in the contours for each subplot, illustrated by the figure below :
Now, I would like to continue to improve this plot by doing :
1) Make the y-axis labels horizontal (b,c,d,e,f,g) of the triangle plot.
1.1) FIRST TRY, I have tested with :
Code: Select all
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = True
g.settings.legend_fontsize = 22
g.settings.axes_labelsize = 22
g.settings.axes_fontsize = 20
# Important parameter : width of 2D contour lines
g.settings.lw_contour = 4
g.settings.title_limit_fontsize = 1
g.settings.axis_tick_x_rotation = 60
# FIRST TRY : Rotate y-axis label to make them horizontal
g.rotate_yticklabels = 90
but the rotation of y-labels is not performed.
1.2) SECOND TRY :
Code: Select all
g.triangle_plot([matrix1, matrix2],
names,
filled = True,
legend_labels = ['FoM = 1240', 'FoM = 1560'],
legend_loc = 'upper right',
contour_colors = ['red','darkblue'],
line_args = [{'lw':2, 'color':'red'},
{'lw':2, 'color':'darkblue'}],
# SECOND TRY : Rotate y-axis label to make them horizontal
rotate_yticklabels = 90
)
not also working .
1.3) and finally tried :
Code: Select all
plt.yticks(rotation='horizontal')
same thing, no rotation carried out.
2) Secondly, I would like to set custom x-ticks values (actually only 3 values, the mean and the minimum/maximum of contours projected from the x-axis delimited by red ellipse (representing 95% C.L = 2 sigma).
I did a test with the following instructions :
Code: Select all
for k in range(0,7):
# Get axis
ax = g.subplots[k, k]
# Caution : inevitably, minorx will be equal to 0
# for likelihood
min_majorx = major_proj_xaxis[1, k]
min_minorx = minor_proj_xaxis[1, k]
# Take the min for major and minor axis of red ellipse
ax.set_xlim(mean[k] - factor_zoom*min_majorx, mean[k] + factor_zoom*min_majorx)
# TRY to set custom limits for xtick, minimum and maximum of the x-values of red contours and the mean, so 3 xticks for each sublplot.
ax.xticks([-0.1, 0, 0.1])
the bounds values [-0.1, 0, 0.1] are just testing values. How to set manually values with the associated xtick and label ?
If someone could see how to enhance these 2 specifications (point 1) and 2)), I woud really appreciate.
Regards