如何在python中使子块更大?

2024-05-08 12:43:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在努力让小插曲更大更清晰。我试图在Box-Muller变换前后,为正态概率分布绘制不同的值。在

我使用以下代码:

i=0
j=1
while (i < len(n)):  
    # Gleichmäßig verteilte Werte zwischen 0 und 1
    u1 = random.rand(n[i])
    u2 = random.rand(n[i])

    # Transformation ausführen
    z1,z2 = gaussian(u1,u2)



    plt.subplot(12,2,i+j)
    hist(u1)
    j += 1
    plt.subplot(12,2,i+j)
    hist(u2)
    j += 1
    plt.subplot(12,2,i+j)
    hist(z1)
    j += 1
    plt.subplot(12,2,i+j)
    hist(z2)
    i += 1

fig = plt.gcf()   
fig.set_size_inches(30, 13)
#fig.tight_layout()
plt.suptitle('test', fontsize=20, y=1.05)
plt.show()

附件是我得到的图。subplots


Tags: boxfigpltrandomhist插曲正态概率分布