Home > OS >  How to make a bar chart on range of values on x-axis and count on the range on y-axis in python?
How to make a bar chart on range of values on x-axis and count on the range on y-axis in python?

Time:11-17

I have a list such as [0.2,0.4,1.2,2.4,5.4,6.0,0.3,3.4..] and I want to group the values in the list to a range(interval can change for different inputs) 0-1,1-2,2-3 and would like to plot a graph where the x-axis is the range and y-axis depicts the no_of_values in the given range?

For the above problem, {0-1:3,1-2:1,2-3:1,3-4:1,4-5:0,5-6:2}

Thanks in advance

CodePudding user response:

Try using enter image description here

  • Related