My list looks like this
top = [('a',1.875),('c',1.125),('d',0.5)]
Can someone help me plot the bar chart with x-axis as a, c, d and y axis values as 1.875 ,1.125, 0.5 ?
I tried plotting using the following code.
import numpy as np
import matplotlib.pyplot as plt
top = [('a',1.875),('c',1.125),('d',0.5)]
labels, values = zip(*top)
indexes = np.arange(len(labels))
width = 1
plt.bar(indexes, values, width)
plt.xticks(indexes + width * 0.5, labels)
plt.savefig('netscore.png')
I am able plot the bar chart but y-axis values are wrong in the chart.
