欢迎光临散文网 会员登陆 & 注册

XDV1.0.0(Pre-alpha)

2023-07-24 16:59 作者:XRJ-Python  | 我要投稿

from matplotlib import pyplot
print('Welcome to XDV1.0.0(Pre-alpha)bilibili:XRJ-Python')
pyplot.rcParams['font.sans-serif'] = ['Arial UnicodeMS', 'simhei']
cmd = ''
data = ''
while True:
   cmd = input()
   if cmd == 'pie':
       print('Input Pie Chart Data:')
       data = input().split()
       data = [int(xh) for xh in data]
       print('Input Image Label:')
       lab = input().split()
       print('Enter image radius:')
       rad = int(input())
       print('Enter image name:')
       name = input()
       pyplot.pie(data,labels=lab,autopct='%.2f%%',radius=rad)
       print('Production in progress, please wait.')
       pyplot.savefig(name+'.png')
       print('Successfully saved!')
       pyplot.show()
   elif cmd == 'plot':
       print('Input X data:')

XDV1.0.0(Pre-alpha)的评论 (共 条)

分享到微博请遵守国家法律