Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Violin Chart 3D

Signature

sp.build_violin3d_chart(
    title: str,
    categories: list[str],
    values: list[float],
    *,
    bandwidth: float = 1.0,
    palette: list[int] | None = None,
    bg_color: str = "#1a1a2e",
    width: int = 900,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "Density",
) -> Chart

Aliases: sp.violin3d


Description

3D violin chart — KDE-based distribution surfaces per category rendered in WebGL.


Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
categorieslist[str]requiredCategory labels
valueslist[float]requiredFlat sample data (equal count per category)
bandwidthfloat1.0KDE bandwidth
palettelist[int] | NoneNonePer-category colors
bg_colorstr"#1a1a2e"Background color
widthint900Canvas width
heightint600Canvas height

Returns

Chart


Examples

import seraplot as sp
import random
groups = ["Control", "Treatment A", "Treatment B"]
means  = [50, 65, 72]
values = [v for m in means for v in [random.gauss(m, 8) for _ in range(80)]]
chart = sp.build_violin3d_chart(
    "Trial Results",
    categories=groups,
    values=values,
)
const sp = require('seraplot');
import random
const groups = ["Control", "Treatment A", "Treatment B"]
const means  = [50, 65, 72]
const values = [v for m in means for v in [random.gauss(m, 8) for _ in range(80)]]
const chart = sp.build_violin3d_chart("Trial Results",
{
    categories: groups,
    values: values
})
import * as sp from 'seraplot';
import random
const groups: string[] = ["Control", "Treatment A", "Treatment B"]
const means: number[] = [50, 65, 72]
const values: number[] = [v for m in means for v in [random.gauss(m, 8) for _ in range(80)]]
const chart = sp.build_violin3d_chart("Trial Results",
{
    categories: groups,
    values: values
})
▶ Live Preview

See also

Signature

sp.build_violin3d_chart(
    title: str,
    categories: list[str],
    values: list[float],
    *,
    bandwidth: float = 1.0,
    palette: list[int] | None = None,
    bg_color: str = "#1a1a2e",
    width: int = 900,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "Density",
) -> Chart

Aliases: sp.violin3d


Description

Graphique en violon 3D — surfaces de distribution basées sur KDE par catégorie rendues en WebGL.


Paramètres

ParamètreTypeDéfautDescription
titlestrrequisTitre du graphique
categorieslist[str]requisÉtiquettes des catégories
valueslist[float]requisDonnées échantillon plates (nombre égal par catégorie)
bandwidthfloat1.0Bande passante KDE
palettelist[int] | NoneNoneCouleurs par catégorie
bg_colorstr"#1a1a2e"Couleur de fond
widthint900Largeur du canvas
heightint600Hauteur du canvas

Retourne

Chart


Exemples

import seraplot as sp
import random

groupes = ["Contrôle", "Traitement A", "Traitement B"]
means  = [50, 65, 72]
values = [v for m in means for v in [random.gauss(m, 8) for _ in range(80)]]

chart = sp.build_violin3d_chart(
    "Résultats de l'essai",
    categories=groupes,
    values=values,
)

Voir aussi