.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Plots/plot_circular.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 .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_Plots_plot_circular.py: Plot circular ============= The density function can be represented using the area of the bars, the height or the transparency (alpha). The default behaviour will use the area. Using the heigth can visually biase the importance of the largest values. Adapted from [#]_. The circular mean was adapted from Pingouin's implementation [#]_. .. [#] https://jwalton.info/Matplotlib-rose-plots/ .. [#] https://pingouin-stats.org/_modules/pingouin/circular.html#circ_mean .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: Python # Author: Nicolas Legrand # Licence: GPL v3 .. GENERATED FROM PYTHON SOURCE LINES 20-22 Using a numpy array of angular values as input ---------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-26 .. code-block:: Python import numpy as np from systole.plots import plot_circular x = np.random.normal(np.pi, 0.5, 100) plot_circular(data=x) .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_circular_001.png :alt: plot circular :srcset: /auto_examples/Plots/images/sphx_glr_plot_circular_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/systole/plots/backends/matplotlib/plot_circular.py:133: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. ax.set_xticklabels(circle_label) .. GENERATED FROM PYTHON SOURCE LINES 27-29 Using a data frame as input --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 29-38 .. code-block:: Python import numpy as np import pandas as pd from systole.plots import plot_circular # Create angular values (two conditions) x = np.random.normal(np.pi, 0.5, 100) y = np.random.uniform(0, np.pi*2, 100) data = pd.DataFrame(data={'x': x, 'y': y}).melt() plot_circular(data=data, y='value', hue='variable') .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_circular_002.png :alt: plot circular :srcset: /auto_examples/Plots/images/sphx_glr_plot_circular_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/systole/plots/backends/matplotlib/plot_circular.py:133: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. ax.set_xticklabels(circle_label) /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/systole/plots/backends/matplotlib/plot_circular.py:133: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. ax.set_xticklabels(circle_label) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.442 seconds) .. _sphx_glr_download_auto_examples_Plots_plot_circular.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_circular.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_circular.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_