I'm Trying to make a graphic using the data of some names and corresponding values, pretty eassy, my question comes up next, when i use the code as follows:
import matplotlib.pyplot as plt
EjecutivoProduccion = [("Sandra",'675'),("María",'709'),("Juan",'838'),("Carlos",'567'),("Julian",'526'),("Teresa",'817'),("Luis",'776'),("Maria",'787'),("Felipe",'645'),("Carol",'997'),("Lucia",'840'),("Mauro",'731'),("John",'599'),("Oscar",'672')]
EjecProd = sorted(EjecutivoProduccion, key=lambda x: x[1])
EjecOrden = []
ProduccOrden = []
for i in range(0,len(EjecProd)):
EjecOrden.append(EjecProd[i][0])
ProduccOrden.append(EjecProd[i][1])
ax =plt.subplot()
plt.title("Productividad por Ejecutivo")
plt.xlabel("Ejecutivos")
plt.ylabel("Productividad")
ax.bar(EjecOrden,ProduccOrden)
plt.show()
The End result comes up as:
I don't really care if the names are mashed together in this case, but the x axis is bases around the values I gave it, I was wondering how could I make there be an existing axis and the values to be just points or the altitudes of the corresponding bars in each case. This would be as for the values distance to have an impact in the separation in the heights of the bars and for the bottom value not to be the lowest one as even if it says it is 526, it gives the impresion on being 0, and I would like this graph to account for both this things, any idea of how could I do it?