我有一個數據文件,該文件是這樣的:如何使用python和給定的數據生成圖像?
1, 23%
2, 33%
3, 12%
我想用Python來生成一個直方圖來表示百分比。我跟着這些命令:
from PIL import Image
img = Image.new('RGB', (width, height))
img.putdata(my_data)
img.show()
但是我得到的錯誤,當我把數據:SystemError: new style getargs format but argument is not a tuple.
我一定要改變我的數據文件嗎?如何?
http://stackoverflow.com/questions/12062920/how-do-i-create-an-image-in-pil-using-a-列表的-RGB元組 – Mani