绘制饼图报错
代码:a = open('ti.txt')
b = a.read()
First = b
Second = ","
end = ""
for i in First:
if i in Second:
First = First.replace(i, "")
F = int(First)
import matplotlib.pyplot as plt
sizes =
explode = (0, 0, 0, 0)
plt.pie(sizes, explode=explode,autopct='%1.1f%%',
shadow=True, startangle=90)
plt.axis('equal')
plt.show()
ti.txt内容:1,
错误: raise ValueError("'explode' must be of length 'x'")
ValueError: 'explode' must be of length 'x'
不添加 explode 参数试试 zltzlt 发表于 2020-8-14 18:36
不添加 explode 参数试试
可以啦!!!谢谢!!!
页:
[1]