How to plot an histogram with matplotlib using python -
this question has answer here:
- histogram matplotlib 6 answers
i have 2 lists:
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] y = [0.5717, 0.699, 0.7243, 0.5939, 0.5383, 0.5093, 0.7001, 0.589, 0.6486, 0.7152, 0.6805, 0.5688, 0.6133, 0.6041, 0.5676]. plt.xlabel('x') plt.ylabel('y')) plt.title("histogram") xbins = [x x in range(len(xaxis))] numbins = len(xaxis) plt.hist(xaxis,xbins ,color='green',alpha=0.6) plt.show() plt.close()
when doing not getting correctly.so if want plot histogram using data. how can using python programming?
i'm not sure if understand question, i'll give shot:
import matplotlib.pyplot plt x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] y = [0.5717, 0.699, 0.7243, 0.5939, 0.5383, 0.5093, 0.7001, 0.589, 0.6486, 0.7152, 0.6805, 0.5688, 0.6133, 0.6041, 0.5676] plt.bar(x, y, color='green', alpha=0.6, align='center') plt.xlabel('x') plt.ylabel('y') plt.title("histogram") plt.show()
is plot looking for? if not, please provide more details.
Comments
Post a Comment