{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Histogram" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import smpl\n", "from smpl import plot\n", "from smpl import stat\n", "from smpl import functions as f\n", "import numpy as np\n", "np.random.seed(1337)\n", "print(smpl.__version__)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data will be binned for histogram like treatment if bins is set." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x= np.random.randn(1000000)\n", "# Default uncertainty of bins is poisson distributed in y direction and none for x\n", "plot.fit(x,f.gauss,bins=20,label=\"data\",binunc=stat.no_dist,init=True)\n", "plot.fit(x,f.gauss,bins=20,label=\"data\",init=True)\n", "plot.fit(x,f.gauss,bins=20,label=\"data\",fmt=\"hist\",init=True)\n", "plot.fit(x,f.gauss,bins=20,label=\"data\",sigmas=1,fmt=\"step\",init=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x= np.random.randn(100000)\n", "plot.fit(stat.normalize(x),stat.normalize(x**3),f.gauss,bins=50,lpos=-1,binunc=stat.no_dist,init=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.15" } }, "nbformat": 4, "nbformat_minor": 4 }