I'm trying to make my chart start from position 0 using hist ()

0

Using USAGE_PLOT is easy to do but I want to do and learn how to use hist. the same way it is in the image below in which it was used usage_plot(trip_data, 'duration', ['duration < 60'], boundary = 0, bin_width = 5)

ButI'mtryingseveraldifferentthingsandI'mnotgettingthesameresult:

plt.figure()trip_data_ex=trip_data[trip_data['duration']<60]data_plot_ex=trip_datadata_plot_ex['count']=1data_plot_ex=trip_data_ex.groupby('duration',as_index=False).count()x_data=trip_data_ex['duration'].unique()min_value=data_plot_ex['duration'].min()bins=[i*5+min_value-1foriinrange(13)]plt.hist(data_plot_ex['count'],bins,width=4.9)plt.show()

Any idea how to get on the first image? Thanks for the help.

    
asked by anonymous 18.09.2017 / 00:24

1 answer

0

I found this answer that uses pylab.hist as the histtype="stepfilled" parameter. If this does not work, you can try using asymmetric bars , increasing the size of problem bars.

If none of these things work, as you have bars together and starting from scratch, you can easily modify your date and plot an area or patch . The date needs a little attention to make the points, because some techniques use slightly different entries. But time should not be too different from making asymmetric bars.

    
18.09.2017 / 11:22