File: histo_violin.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from vedo import *
from vedo.pyplot import violin
import numpy as np

n = 1000

acts = [
    Text3D('gaussian', pos=(0,4.5), s=0.3, c='k', justify='center'),
    violin(np.random.randn(n)),

    Text3D('exponential', pos=(5,-1), s=0.3, c='k', justify='center'),
    violin(np.random.exponential(1, n), x=5, width=3, splined=False, centerline=False, c='t', lc='k'),

    Text3D('chisquare', pos=(10,11), s=0.3, c='k', justify='center'),
    violin(np.random.chisquare(9, n)/4, x=10, vlim=(0,10), c='lg', lc='dg'),
]

show(acts, axes=dict(xtitle=False, ytitle='distribution')).close()