带有triangle_plot的x和y标签的字体大小

发布于 2025-01-21 13:31:06 字数 1206 浏览 0 评论 0原文

我想增加三角图的x和y标签的字体大小。我在这个问题中尝试了:更改标签的大小在python 但这对我不起作用...这是我的代码,

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')

有人知道为什么吗?这是产生的数字作为证据,表明该字体很小

”在此处输入图像描述

请如何增加字体?

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

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?

+ '\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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒芜了季节 2025-01-28 13:31:06

问题在于

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

之前。

g.triangle_plot(samples2, filled=True)

在解决问题之前将其放在

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文