.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_polyfit_ci.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_polyfit_ci.py: Polynomial fit with confidence band =================================== .. GENERATED FROM PYTHON SOURCE LINES 5-22 .. code-block:: Python import numpy as np, pandas as pd import seaborn.objects as so import seaborn_objects_recipes as sor rng = np.random.default_rng(0) x = np.linspace(0, 2*np.pi, 150) y = np.sin(x) + rng.normal(0, 0.2, size=x.size) df = pd.DataFrame({"x": x, "y": y}) ( so.Plot(df, x="x", y="y") .add(so.Dot(alpha=0.35)) .add(so.Line(), pf := sor.PolyFitWithCI(order=2, gridsize=200, alpha=0.05)) .add(so.Band(), pf) .label(title="Quadratic fit ± 95% CI", x="x", y="y") .plot() ) .. _sphx_glr_download_auto_examples_plot_polyfit_ci.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/oosei25/seaborn_objects_recipes/main?filepath=docs/tutorial/auto_examples/plot_polyfit_ci.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_polyfit_ci.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_polyfit_ci.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_polyfit_ci.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_