title: How to plot a standard density curve using plotly?
body: <p>How to plot a density curve in python using plotly?</p>
  
  <p>Specifically, I would like to do that for some standard densities.</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>So far, the best way of achieving what I ask for (in a Jupyter notebook):</p>
  
  <pre><code>import numpy as np
  from scipy import stats
  
  import plotly.graph_objs as go
  from plotly.offline import init_notebook_mode, iplot
  init_notebook_mode(connected=True)
  </code></pre>
  
  <p><strong>Plotting</strong></p>
  
  <pre><code>xrange = np.arange(-4.5,5,0.0025)
  norm = go.Scatter(x=xrange, 
                    y=stats.norm(loc=0, scale=1).pdf(xrange), 
                    mode='lines',
                    line=dict(width=1.5),
                    name='Normal',
                   )
  lognorm = go.Scatter(x=xrange[xrange&gt;0], 
                       y=stats.lognorm(s=1, loc=0, scale=1).pdf(xrange[xrange&gt;0]), 
                       mode='lines',
                       line=dict(width=1.5),
                       name='Lognormal',
                      )
  cauchy = go.Scatter(x=xrange, 
                       y=stats.cauchy(loc=0, scale=1).pdf(xrange), 
                       mode='lines',
                       line=dict(width=1.5),
                       name='Cauchy',
                      )
  data = [norm, lognorm, cauchy]
  iplot(data, show_link=False)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bokVN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bokVN.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>I was looking for an easy, parsimonious way, as it is done in <em>Mathematica</em> for instance: </p>
  
  <pre><code>Plot[{PDF[NormalDistribution[], x], PDF[LogNormalDistribution[0, 1], x], PDF[CauchyDistribution[], x]}, {x, -4.5, 4.5}]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0wPR0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0wPR0.png" alt="enter image description here"></a></p>