wl -- What to plot list.
t -- Graph title.
"""
- if len(wl) <= 0:
+ if len(wl) < 1:
raise ValueError
+ elif len(wl) == 1:
+ wl.append([])
f, ax = plt.subplots()
ax.set_title(t)
w = wl[0]
tick_label=[k for k, v in w.items()],
width=1 / (len(wl) + 1),
)
- for i in range(1, len(wl)):
+ for i in range(1, len(wl) - 1):
w = wl[i]
ax.bar(
[j + i * 1/len(wl) for j in range(len(w))],
ax.minorticks_on()
ax.grid(which="major", linestyle="-", linewidth="0.5", color="gray")
ax.grid(which="minor", linestyle=":", linewidth="0.5", color="gray")
+ plt.legend(wl[-1])
plt.show()
def histplot(w={}, t=""):