To plot density smooth histogram of large number of datas(about 150000) of csv file in matplotlib

Viewed 111

i want to plot smooth density histogram of a large datas of values (which range from 0.0001 to 6) which is stored in a csv file.It contains about 200k data points. And i also want it to compare with the graph of function (which is a second problem). How can i do this? I tried the program below. But it is showing that the array imported is containing of a list of barcontainer objects. No smooth curve is obtaining.How can i improve my program to get a smooth histogram curve?

'datas=pd.read_csv('C:/Users/spacing ratios.csv')
 fig, axs = plt.subplots(1, 1,
 figsize =(10, 7),
 tight_layout = True)
 axs.hist(datas,range=(0,6),density='True')'

This is what i am getting

enter image description here

0 Answers
Related