**deprecated**, use instead the plotly.graph_objects trace :class:`plotly.graph_objects.Violin`. :param (list|array) data: accepts either a list of numerical values, a list of dictionaries all with identical keys and at least one column of numeric values, or a pandas da
(
data,
data_header=None,
group_header=None,
colors=None,
use_colorscale=False,
group_stats=None,
rugplot=True,
sort=False,
height=450,
width=600,
title="Violin and Rug Plot",
)
| 430 | |
| 431 | |
| 432 | def create_violin( |
| 433 | data, |
| 434 | data_header=None, |
| 435 | group_header=None, |
| 436 | colors=None, |
| 437 | use_colorscale=False, |
| 438 | group_stats=None, |
| 439 | rugplot=True, |
| 440 | sort=False, |
| 441 | height=450, |
| 442 | width=600, |
| 443 | title="Violin and Rug Plot", |
| 444 | ): |
| 445 | """ |
| 446 | **deprecated**, use instead the plotly.graph_objects trace |
| 447 | :class:`plotly.graph_objects.Violin`. |
| 448 | |
| 449 | :param (list|array) data: accepts either a list of numerical values, |
| 450 | a list of dictionaries all with identical keys and at least one |
| 451 | column of numeric values, or a pandas dataframe with at least one |
| 452 | column of numbers. |
| 453 | :param (str) data_header: the header of the data column to be used |
| 454 | from an inputted pandas dataframe. Not applicable if 'data' is |
| 455 | a list of numeric values. |
| 456 | :param (str) group_header: applicable if grouping data by a variable. |
| 457 | 'group_header' must be set to the name of the grouping variable. |
| 458 | :param (str|tuple|list|dict) colors: either a plotly scale name, |
| 459 | an rgb or hex color, a color tuple, a list of colors or a |
| 460 | dictionary. An rgb color is of the form 'rgb(x, y, z)' where |
| 461 | x, y and z belong to the interval [0, 255] and a color tuple is a |
| 462 | tuple of the form (a, b, c) where a, b and c belong to [0, 1]. |
| 463 | If colors is a list, it must contain valid color types as its |
| 464 | members. |
| 465 | :param (bool) use_colorscale: only applicable if grouping by another |
| 466 | variable. Will implement a colorscale based on the first 2 colors |
| 467 | of param colors. This means colors must be a list with at least 2 |
| 468 | colors in it (Plotly colorscales are accepted since they map to a |
| 469 | list of two rgb colors). Default = False |
| 470 | :param (dict) group_stats: a dictionary where each key is a unique |
| 471 | value from the group_header column in data. Each value must be a |
| 472 | number and will be used to color the violin plots if a colorscale |
| 473 | is being used. |
| 474 | :param (bool) rugplot: determines if a rugplot is draw on violin plot. |
| 475 | Default = True |
| 476 | :param (bool) sort: determines if violins are sorted |
| 477 | alphabetically (True) or by input order (False). Default = False |
| 478 | :param (float) height: the height of the violin plot. |
| 479 | :param (float) width: the width of the violin plot. |
| 480 | :param (str) title: the title of the violin plot. |
| 481 | |
| 482 | Example 1: Single Violin Plot |
| 483 | |
| 484 | >>> from plotly.figure_factory import create_violin |
| 485 | >>> import plotly.graph_objs as graph_objects |
| 486 | |
| 487 | >>> import numpy as np |
| 488 | >>> from scipy import stats |
| 489 |
no test coverage detected