Font size of x and y label with triangle_plot

272 views Asked by At

I want to increase the fontsize of the x and y label of my triangle plot. I tried as in this question: Changing the size of labels of plots in python but it's not working for me... here is my code

import getdist.plots as gdplt
from getdist.mcsamples import loadMCSamples
from getdist.mcsamples import MCSamplesFromCobaya
from getdist import plots, MCSamples
.
.
.
names2 = ["p1", "p2", "p3", "p4", "p5", "p6", 'p7']
labels2 =  my_head_new[2:9]
samples2 = MCSamples(samples = sample[burn:,2:9], names = names2, labels = labels2)#, settings={'smooth_scale_2D':0.3})
plt.figure()
g = plots.getSubplotPlotter()
g.triangle_plot(samples2, filled=True)
g.settings.lab_fontsize = 40
g.settings.axes_fontsize = 40
plt.suptitle(r'Test92: vanilla + $\Omega_k$' + '\n nlive: 10d \n log(Z)= -315.98598 $\pm$ 0.66455', ha ='center', va='bottom', fontsize = 25)
plt.savefig('plot_triangle_vanilla_92_burned.png', dpi=300, bbox_inches='tight')
plt.close('all')

Does anyone know why? This is the produced figure as proof that the font is very small

enter image description here

How can I increase the font, please?

1

There are 1 answers

0
Apinorr On BEST ANSWER

The problem was that

g.settings.lab_fontsize = 40
g.settings.axes_fontsize = 40

was after

g.triangle_plot(samples2, filled=True)

putting it before solved the problem.