<jupyter_start><jupyter_text>Title  Violin Element  Dependencies Plotly  Backends Bokeh Matplotlib Plotly<jupyter_code>import numpy as np
import holoviews as hv
hv.extension('plotly')<jupyter_output><empty_output><jupyter_text>A ``Violin`` element is used to visualise the distribution of a dataset by displaying its probability density. It is very similar to the ``BoxWhisker`` element but provides a more faithful representation even for bi- or multimodal data. The probability density is shown by the area akin to a vertical and mirrored ``Distribution`` element.  The thick black bar in the centre represents the interquartile range, the thin black line extended from it represents the 95% confidence intervals, and the white dot is the median.The data of a ``Violin`` Element may have any number of key dimensions representing the grouping of the value dimension and a single value dimensions representing the distribution of values within each group. See the [Tabular Datasets](../../../user_guide/08-Tabular_Datasets.ipynb) user guide for supported data formats, which include arrays, pandas dataframes and dictionaries of arrays.In the simplest case a ``Violin`` can be used to display a single distribution of values, such as a NumPy array of normally distributed values:<jupyter_code>np.random.seed(37)
violin = hv.Violin(np.random.randn(100), vdims='Value')
violin<jupyter_output><empty_output><jupyter_text>The ``Violin`` element is particularly useful to compare multiple distribution across different categories. As a simple example we can create a dataset of values with randomly assigned Group and Category values and compare the distributions.<jupyter_code>groups = [chr(65+g) for g in np.random.randint(0, 3, 200)]
violin = hv.Violin((groups, np.random.randint(0, 5, 200), np.random.randn(200)),
                   ['Group', 'Category'], 'Value')

violin.opts(height=400, width=600)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07772020725388601, 'fraction_numerical': 0.015544041450777202, 'mean_word_length': 5.613013698630137, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '127813', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 548, 'n_tokens_neox': 516, 'n_words': 230, 'path': 'examples/reference/elements/plotly/Violin.ipynb', 'repo_name': 'ppwadhwa/holoviews', 'size': '1930'}