画柱状图(查看英文文章单词出现频次)



zt=input("请输入字体:")
ztds=input("请输入字体大小:")
def yid(x,y):
    penup()
    goto( x,y )
    pendown()

def 移动(i):
    pu()
    fd(i)
    pd()

def 画线(x,y,xi,yi):
    yid(x,y)
    goto(xi,yi)

def 画矩形(x,y):
    x = x*x_xishu-300
    y = y*y_xishu
    begin_fill()
    画线(x-10,-250,x-10,y-250)
    画线(x-10,y-250,x+10,y-250)
    画线(x+10,y-250,x+10,-250)
    画线(x+10,-250,x-10,-250)
    end_fill()

def 画多个矩形():
    for i in range(j):
        画矩形(i,counts[i])

def 文字(x,y,t,s):
    pu()
    goto(x,y)
    pd()
    write(t,False,'center',font=(zt,s,'normal'))

def 画柱状图():
    画多个矩形()
    for i in range(j):
        文字(i*x_xishu-300,-280,words[i],ztds)
        文字(i*x_xishu-300,counts[i]*y_xishu-230,counts[i],ztds)   
    文字(0,250,'单词频次统计图',50)

def 删除符号(a):
    for i in a:  #变量i依次取到序列a中每一个元素
        if i in """`’~!@#$%^&*()_+-={}|[]\;',./:"<>? """: 
        #如果i是这些符号的一员
            a=a.replace(i,' ') #将i替换为空格
    
    return a #返回a

#改文章
files_a= '''[1] T. Paulay and J. R. Binney. Diagonally Reinforced coupling beams of shear Walls[S].ACI Special Publication 42, Detroit, 1974, 2: 579-598[2] Lam WY, Su R K L, Pam H J. Experimental study of plate-reinforced composite deep coupling beams[J]. Structural Design Tall Special Building, 2009(18): 235-257[3] ACI 318-02: Building Code Requirements for Structural Concrete, ACI318R-02:Commentary, An ACI Standard, reported by ACI Com-mittee318, American Concete Institute, 2002[4] Siu W H, Su R K L. Effects of plastic hinges on partial interacti
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值