如何调整Python3中蝗虫的形状曲线?
graph-code-from Math Import fact Import Numpy as NP Import Matplotlib。py plot as PLT # factorial def fact(n):Return Factual(n)# Catalan formula defcat _ direct(n):Return fact(2 * n)//fact(n+1)//fact(n)max = 20 nList = range(25)valley =[]print " input the limit for Catalan numbers to print:100000000 " for I in nList:if I & lt;= max:val = cat _ direct(I)vallist . append(val)print " C % s is:" % I,val else: print "C %s is:"%i,1000000000 valist。追加(10000000)#-生成曲线PLT。Plot (nlist,valist,' ro ')。Axis ([0,25,0,10000000000])PLT . xlabel(" n ")PLT . ylabel(" Catalan ")PLT . title(" Cn+1 = 2 *(2n+1)* Cn/(n+2)")PLT . show()