Я пытаюсь построить гистограмму, основанную на процентах, я получаю следующее сообщение об ошибке:
ValueError: incompatible sizes: argument 'height' must be length 6 or scalar
Это как-то связано с этой линией, но я не уверен, что не так с аргументом высоты ,
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
xaxis=['epic1', 'epic2', 'epic3', 'epic4', 'epic5', 'epic6']
n=len(xaxis)
names = ('epic1', 'epic2', 'epic3', 'epic4', 'epic5', 'epic6')
data = {'done': [57,53,49,65,78,56,89],
'progress': [23,12,34,11,34,12,12],
'todo' :[11,5,6,7,8,4,6]}
df = pd.DataFrame(data)
df['total'] = df['done'] + df['progress'] + df['todo']
df['done_per'] = df['done'] / df['total'] * 100
df['progress_per'] = df['progress'] / df['total'] * 100
df['todo_per'] = df['todo'] / df['total'] * 100
barWidth = 0.25
# Create green Bars
plt.bar(xaxis, done_per, color='#b5ffb9', edgecolor='green', width=barWidth)
# Create orange Bars
plt.bar(xaxis, progress_per, bottom=done_per, color='#f9bc86',
edgecolor='orange', width=barWidth)
# Create blue Bars
plt.bar(xaxis, todo_per, bottom=[i+j for i,j in zip(done_per, progress_per)],
color='blue', edgecolor='blue', width=barWidth)
plt.xticks(xaxis, names)
plt.xlabel("epics")
plt.show()