2

I'm having a difficult time figuring out how to make plots similar to the plots of the posterior probability distribution (in red) similar to those found on page 17 here.

It is clear that these are many lines with low alpha values overlaid. This gives the effect of dark red in the middle with the shading gradually lightening as you move outwards. I have found it difficult choosing combination of the right alpha and number of lines to overlay to achieve that effect.

What I wish I could do was to use something similar to fill_between but instead of a shaded area, have the shading smoothly fade out as you get to the edges. Any ideas how to accomplish this?

bill_e
  • 930
  • 2
  • 12
  • 24
  • Do you have the functional form of the posterior? If so, you can just you can create a 2-d grid (e.g., with `np.meshgrid()`) and make the value of every cell equal to the posterior for that cell. – dslack Nov 17 '15 at 03:46
  • I'm afraid I may end up having to do it that way. Looking closer at the linked picture, it looks like they repeatedly called `fill_between` to create that effect. – bill_e Nov 17 '15 at 19:34
  • Maybe, but a simpler way to achieve the same look would be with `matplotlib.pyplot.contourf()`. – dslack Nov 17 '15 at 20:32
  • 1
    The answer [here](http://stackoverflow.com/a/29656697/588071) might be of some use – tmdavison Nov 18 '15 at 11:09

0 Answers0