I have a pandas df that looks something like this
,Difference Max
0,12.0
1,1.0
2,-7.0
3,-5.0
4,2.0
5,3.0
6,10.0
7,0.0
8,0.0
9,3.0
10,3.0
from this df I would like to plot a bar chart/histogram showing the number of occurrences for each value in the 'Difference Max' column. I currently have this bar plot
using the following code:
df_maxdif['Difference Max'].value_counts().plot(kind='bar')
but I would like to have the x-axis in numerical order from -21 on the leftmost side up to 10 on the rightmost side. I've tried simply plotting kind = 'hist' but its not quite what I'm looking for.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.