.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/datasets/plot_bee_dance.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_datasets_plot_bee_dance.py: Honey Bee Dance Data ==================== Hello world .. GENERATED FROM PYTHON SOURCE LINES 8-16 .. code-block:: default import numpy as np import seaborn as sns from etudes.datasets import load_bee_dance_dataframe golden_ratio = 0.5 * (1 + np.sqrt(5)) .. GENERATED FROM PYTHON SOURCE LINES 18-23 .. code-block:: default data = load_bee_dance_dataframe(base_dir="../../datasets") data = data.assign(label=data.label.map(dict(waggle="waggle", turn_right="turn right", turn_left="turn left"))) .. GENERATED FROM PYTHON SOURCE LINES 24-30 .. code-block:: default g = sns.relplot(x='x', y='y', units='phase', estimator=None, hue="label", col="sequence", col_wrap=3, kind="line", sort=False, data=data, height=5, aspect=1, alpha=0.8, facet_kws=dict(sharex=False, sharey=False)) g.set_axis_labels(r"$x$", r"$y$") .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_001.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 31-36 .. code-block:: default sns.relplot(x="timestamp", y="x", units='phase', estimator=None, hue="label", col="sequence", col_wrap=3, kind="line", data=data, height=5, aspect=golden_ratio, alpha=0.8, facet_kws=dict(sharex=False, sharey=False)) .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_002.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 37-42 .. code-block:: default sns.relplot(x="timestamp", y="y", units='phase', estimator=None, hue="label", col="sequence", col_wrap=3, kind="line", data=data, height=5, aspect=golden_ratio, alpha=0.8, facet_kws=dict(sharex=False, sharey=False)) .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_003.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 43-48 .. code-block:: default sns.relplot(x="timestamp", y="t", units='phase', estimator=None, hue="label", col="sequence", col_wrap=3, kind="line", data=data, height=5, aspect=golden_ratio, alpha=0.8, facet_kws=dict(sharex=False)) .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_004.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 49-57 .. code-block:: default long_data = data.melt(id_vars=["sequence", "timestamp", "label"], value_vars=['x', 'y'], var_name="signal") sns.relplot(x="timestamp", y="value", hue="signal", col="sequence", col_wrap=3, kind="line", data=long_data, height=5, aspect=golden_ratio, alpha=0.8, facet_kws=dict(sharex=False, sharey=False)) .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_005.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 58-65 .. code-block:: default g = sns.FacetGrid(data, hue="label", col="sequence", col_wrap=3, height=5, aspect=golden_ratio, subplot_kws=dict(projection='polar'), sharey=False, despine=False) g.map(sns.scatterplot, "t", "timestamp") .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_006.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 66-72 .. code-block:: default g = sns.relplot(x="t", y="timestamp", units='phase', estimator=None, hue="label", col="sequence", col_wrap=3, kind="line", sort=False, data=data, height=5, aspect=golden_ratio, alpha=0.8, facet_kws=dict(subplot_kws=dict(projection='polar'), sharey=False, despine=False)) .. image:: /auto_examples/datasets/images/sphx_glr_plot_bee_dance_007.png :alt: sequence = 1, sequence = 2, sequence = 3, sequence = 4, sequence = 5, sequence = 6 :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 21.934 seconds) .. _sphx_glr_download_auto_examples_datasets_plot_bee_dance.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_bee_dance.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_bee_dance.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_