Skip to content

Commit

Permalink
Use distribution in plotting of credible interval
Browse files Browse the repository at this point in the history
  • Loading branch information
arm61 committed Dec 5, 2022
1 parent 3f1f89b commit f121ed9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/source/arrhenius_t.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,20 @@
{
"cell_type": "code",
"execution_count": null,
"id": "56818592-cdf0-4971-a77d-9b0364f0c214",
"id": "afbbfa87-d83b-4686-bb2f-ae9c692dc7f2",
"metadata": {},
"outputs": [],
"source": [
"plt.errorbar(1000/s.x, s.y.n, s.y.ci(), marker='o', ls='', zorder=10)\n",
"for i in np.random.randint(s.activation_energy.size, size=128):\n",
" plt.plot(1000/s.x, s.function(s.x, *s.get_sample(i)), color='k', alpha=0.05)\n",
"credible_intervals = [[16, 84], [2.5, 97.5], [0.15, 99.85]]\n",
"alpha = [0.6, 0.4, 0.2]\n",
"\n",
"plt.errorbar(1000/s.x, s.y.n, s.y.ci(), marker='o', ls='', color='k', zorder=10)\n",
"for i, ci in enumerate(credible_intervals):\n",
" plt.fill_between(1000/s.x,\n",
" *np.percentile(s.distribution, ci, axis=1),\n",
" alpha=alpha[i],\n",
" color='#0173B2',\n",
" lw=0)\n",
"plt.yscale('log')\n",
"plt.xlabel('$1000T^{-1}$/K$^{-1}$')\n",
"plt.ylabel('$D$/cm$^2$s$^{-1}$')\n",
Expand Down

0 comments on commit f121ed9

Please sign in to comment.