Python Forum
Plot Probability Density of an Histogram
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plot Probability Density of an Histogram
#2
To plot probability density distribution from empirical data you need to estimate probability density first.
One of the ways to do it is to use the kernel density estimation approach (see scipy's kde density estimator).
Also, you can use ready-made function from seaborn package.
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
x=np.random.randn(10000)                                                                                                                                                                              
sns.distplot(x) #plots histogram and kde-estimation of the pdf.
plt.show()
Reply


Messages In This Thread
RE: Plot Probability Density of an Histogram - by scidam - Jun-28-2018, 06:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  inserting something into probability density SchroedingersLion 1 2,123 Jan-06-2020, 09:15 AM
Last Post: Gribouillis
  Get underlying function from Kernel Density Estimation jpython 3 2,831 Dec-05-2019, 11:23 AM
Last Post: jpython
  How to get the probability density function of my data set jpython 1 2,304 Dec-04-2019, 12:49 PM
Last Post: Larz60+
  finding the integral of probability density function Staph 3 3,660 Aug-11-2019, 09:19 AM
Last Post: buran
  How to fit a 2D histogram like in ROOT? Zandar 2 4,129 Aug-06-2019, 03:01 PM
Last Post: Zandar
  MatPlotLib 2d plot of current density? ruben 0 2,202 May-13-2019, 06:47 AM
Last Post: ruben
  How to check for nested dataframe density? python_newbie09 0 1,980 Aug-27-2018, 07:34 PM
Last Post: python_newbie09
  Draw Weibull distribution probability function based on Confidence interval farzadtb 1 3,706 Jul-31-2018, 03:21 PM
Last Post: Vysero
  histogram error alyssaantarctica 1 3,759 Jul-09-2018, 10:46 PM
Last Post: Larz60+
  histogram with matplotlib vaugirard 10 6,245 Jun-01-2018, 04:13 AM
Last Post: vaugirard

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020