Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the size of labels of plots in python

I am using GetDist for plotting contours in jupyter. I am wondering how to change the size of numbers in axes and labels of parameters. There are some lines in the code containing labels as follows:

a,b,c = np.genfromtxt('data/data.txt',unpack=True)
names = ['H','M','z']
labels =  ['H','M','z']
samples0 = MCSamples(samples=[a,b,c],names = names, labels = labels)
g.triangle_plot([samples0],['H','M','z'],legend_labels=['Summation of data'], legend_loc='upper right',filled=True)

The problem is when the number of parameter goes up, the plot should be smaller to placed in a printed paper and then we cannot see numbers and parameters' labels.

Thank you

like image 664
Ma Y Avatar asked Sep 16 '25 19:09

Ma Y


1 Answers

I found the answer which is tricky

g.settings.axes_fontsize = 20
g.settings.lab_fontsize = 30
g.settings.x_label_rotation=47
g.settings.legend_fontsize = 40

by the use of g.setting in GetDist we can customize the plots.

like image 116
Ma Y Avatar answered Sep 18 '25 10:09

Ma Y