In [3]:
wave = arange(1000)+2500.

In [4]:
flux = power(wave/1000., -1.54)

In [5]:
plot(wave, flux)


Out[5]:
[<matplotlib.lines.Line2D at 0x10867eb10>]

In [6]:
import scipy.stats as stats

In [21]:
lines = stats.norm.pdf(wave/1000., 2.8, 0.01)*0.002

In [22]:
plot(wave, flux, '--', wave, flux+lines, '-')


Out[22]:
[<matplotlib.lines.Line2D at 0x110609bd0>,
 <matplotlib.lines.Line2D at 0x110609e50>]

In [9]:
plot(wave, lines)


Out[9]:
[<matplotlib.lines.Line2D at 0x10f6a58d0>]

In [10]:
range = np.arange(-10, 10, 0.001)
plot(range, norm.pdf(range,0,2))


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-ecf6a74e2d34> in <module>()
      1 range = np.arange(-10, 10, 0.001)
----> 2 plot(range, norm.pdf(range,0,2))

AttributeError: 'function' object has no attribute 'pdf'

In [11]:
range = np.arange(-10, 10, 0.001)
plot(range, stats.norm.pdf(range,0,2))


Out[11]:
[<matplotlib.lines.Line2D at 0x10fb9a310>]

In [23]:
wave = arange(1000)*0.2+2700.
lines = stats.norm.pdf(wave/1000., 2.8, 0.01)*0.002
flux = power(wave/1000., -1.54)

In [24]:
plot(wave, flux, '--', wave, flux+lines, '-', wave, flux*0.7, '--', wave, flux*0.7+lines, '-')


Out[24]:
[<matplotlib.lines.Line2D at 0x1106a5290>,
 <matplotlib.lines.Line2D at 0x1106a5510>,
 <matplotlib.lines.Line2D at 0x1106a5bd0>,
 <matplotlib.lines.Line2D at 0x1106aa250>]

In [ ]: