.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_line_label.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_line_label.py: Line labeling at series endpoints ================================= .. GENERATED FROM PYTHON SOURCE LINES 5-25 .. code-block:: Python import numpy as np import pandas as pd import seaborn.objects as so import seaborn_objects_recipes as sor t = np.arange(0, 50) df = pd.DataFrame({ "t": np.tile(t, 3), "y": np.r_[t, t*0.6 + 5, t*1.2 - 7], "series": np.repeat(["A", "B", "C"], t.size), }) ( so.Plot(df, x="t", y="y", color="series", text="series") .add(so.Lines(), so.Agg(), roll := sor.Rolling(window_type="gaussian", window_kwargs={"std": 2})) .add(sor.LineLabel(offset=6), so.Agg(), roll) .label(title="Rolling smoothed lines with endpoint labels", x="t", y="y") .plot() ) .. _sphx_glr_download_auto_examples_plot_line_label.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_line_label.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_line_label.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_line_label.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_line_label.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_