{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "1c54b0f5",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "a4180af0",
            "cell_type": "markdown",
            "source": "Instantiate a distribution with the desired parameters:\n",
            "metadata": {}
        },
        {
            "id": "c0125839",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import stats\nX = stats.Normal(mu=1., sigma=2.)",
            "outputs": []
        },
        {
            "id": "f13a79aa",
            "cell_type": "markdown",
            "source": "Plot the PDF over the central 99.9% of the distribution.\nCompare against a histogram of a random sample.\n",
            "metadata": {}
        },
        {
            "id": "63e5eaa0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "ax = X.plot()\nsample = X.sample(10000)\nax.hist(sample, density=True, bins=50, alpha=0.5)\nplt.show()",
            "outputs": []
        },
        {
            "id": "eb6c2657",
            "cell_type": "markdown",
            "source": "Plot ``logpdf(x)`` as a function of ``x`` in the left tail,\nwhere the log of the CDF is between -10 and ``np.log(0.5)``.\n",
            "metadata": {}
        },
        {
            "id": "2ec2f67d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X.plot('x', 'logpdf', t=('logcdf', -10, np.log(0.5)))\nplt.show()",
            "outputs": []
        },
        {
            "id": "13a4f2a9",
            "cell_type": "markdown",
            "source": "Plot the PDF of the normal distribution as a function of the\nCDF for various values of the scale parameter.\n",
            "metadata": {}
        },
        {
            "id": "4b2ae5d0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X = stats.Normal(mu=0., sigma=[0.5, 1., 2])\nX.plot('cdf', 'pdf')\nplt.show()",
            "outputs": []
        }
    ]
}