Skip to main content

Statistical Charts with Vizly

Exploring data distributions, relationships, and multi-dimensional patterns requires specialized chart types. Vizly gives you statistical charts that work directly with DataFrames or dict types (list[dict], dict[list]). Use chart.render('file.html') to write to a file or chart.to_html() for a string.

Boxplot for score distributions

Compare distributions across groups at a glance.

import pandas as pd
import vizly as vz

vz.set_theme("corporate")

df = pd.DataFrame({
'group': ['Alpha']*9 + ['Beta']*9 + ['Gamma']*9 + ['Delta']*9,
'score': [50, 56, 60, 62, 64, 66, 70, 72, 76,
55, 62, 68, 71, 73, 77, 82, 85, 91,
34, 44, 51, 55, 58, 63, 69, 73, 80,
65, 71, 75, 78, 80, 83, 87, 90, 94],
})
chart = vz.boxplot(df, x='group', y='score',
title='Score distribution by group', theme='corporate')
chart.to_html()

Scatter plot for correlation

Visualize the relationship between two variables.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'height': [1.86, 1.726, 1.893, 1.829, 1.588, 1.94, 1.854, 1.864,
1.601, 1.73, 1.698, 1.921, 1.808, 1.879, 1.727, 1.641,
1.772, 1.576, 1.881, 1.803, 1.853, 1.692, 1.938, 1.907,
1.861, 1.628, 1.737, 1.568, 1.612, 1.823, 1.848, 1.937,
1.68, 1.698, 1.738, 1.626],
'weight': [58.2, 74.8, 62.9, 84.2, 73.0, 92.0, 85.6, 67.0,
91.9, 90.6, 70.6, 65.8, 84.8, 58.7, 61.6, 52.4,
89.8, 83.9, 85.8, 89.5, 74.0, 79.3, 58.7, 57.5,
84.1, 74.6, 79.1, 88.7, 82.5, 78.6, 78.8, 66.6,
53.5, 73.0, 62.3, 71.6],
})
chart = vz.scatter(df, x='height', y='weight',
title='Height vs weight', theme='corporate')

Effect scatter (animated ripple)

effect_scatter adds a ripple animation to each point, drawing attention to key data points.

chart = vz.effect_scatter(df, x='height', y='weight', 
title='Height vs weight (emphasized)',
theme='corporate')

Heatmap for correlation matrices

Visualize density or intensity across two categorical dimensions.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'day': ['Mon', 'Mon', 'Mon', 'Mon', 'Mon', 'Tue', 'Tue', 'Tue', 'Tue', 'Tue',
'Wed', 'Wed', 'Wed', 'Wed', 'Wed', 'Thu', 'Thu', 'Thu', 'Thu', 'Thu',
'Fri', 'Fri', 'Fri', 'Fri', 'Fri', 'Sat', 'Sat', 'Sat', 'Sat', 'Sat',
'Sun', 'Sun', 'Sun', 'Sun', 'Sun'],
'hour': ['9am', '12pm', '3pm', '6pm', '9pm']*7,
'value': [20, 40, 60, 80, 32, 32, 52, 72, 24, 44,
44, 64, 84, 36, 56, 56, 76, 28, 48, 68,
68, 20, 40, 60, 80, 80, 32, 52, 72, 24,
24, 44, 64, 84, 36],
})
chart = vz.heatmap(df, x='day', y='hour', values='value',
title='Activity density by day/hour', theme='corporate')

Parallel coordinates for multi-dimensional data

Compare many dimensions simultaneously. Each line is a data point, each axis is a dimension.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'latency': [12, 18, 9, 28, 15, 22, 11, 31, 17, 8],
'throughput': [820, 640, 910, 420, 760, 580, 880, 390, 700, 950],
'errors': [0.2, 1.1, 0.1, 3.4, 0.6, 1.8, 0.3, 4.1, 0.9, 0.05],
'cpu': [34, 51, 28, 78, 42, 63, 31, 86, 47, 22],
'memory': [48, 62, 41, 88, 55, 71, 39, 92, 58, 36],
})
chart = vz.parallel(df, dimensions=['latency', 'throughput', 'errors', 'cpu', 'memory'],
title='Service profiles', theme='corporate')

Radar for capability comparison

Compare entities across multiple metrics on a circular radar.

import pandas as pd
import vizly as vz

df = pd.DataFrame({
'name': ['Atlas', 'Nova', 'Pulse'],
'speed': [88, 72, 95],
'power': [76, 91, 68],
'range': [81, 64, 87],
'accuracy': [90, 85, 78],
'efficiency': [70, 88, 82],
})
chart = vz.radar(df, names='name',
values=['speed', 'power', 'range', 'accuracy', 'efficiency'],
title='Product capability radar', theme='corporate')

Statistical dashboard

Combine all statistical views for a comprehensive data exploration dashboard.

import pandas as pd
import vizly as vz

vz.set_theme("corporate")

df_box = pd.DataFrame({
'group': ['A']*9 + ['B']*9 + ['C']*9 + ['D']*9,
'score': [50, 56, 60, 62, 64, 66, 70, 72, 76,
55, 62, 68, 71, 73, 77, 82, 85, 91,
34, 44, 51, 55, 58, 63, 69, 73, 80,
65, 71, 75, 78, 80, 83, 87, 90, 94],
})
df_scatter = pd.DataFrame({
'x': range(1, 31), 'y': [v + (hash(str(v)) % 20 - 10) for v in range(1, 31)],
})
df_radar = pd.DataFrame({
'name': ['Product A', 'Product B'],
'speed': [88, 72], 'power': [76, 91], 'range': [81, 64],
'accuracy': [90, 85], 'efficiency': [70, 88],
})
df_parallel = pd.DataFrame({
'latency': [12, 18, 9, 28, 15], 'throughput': [820, 640, 910, 420, 760],
'errors': [0.2, 1.1, 0.1, 3.4, 0.6], 'cpu': [34, 51, 28, 78, 42],
'memory': [48, 62, 41, 88, 55],
})

chart = vz.page(charts=[
vz.boxplot(df_box, x='group', y='score', title='Score distribution'),
vz.scatter(df_scatter, x='x', y='y', title='Data correlation'),
vz.radar(df_radar, names='name',
values=['speed', 'power', 'range', 'accuracy', 'efficiency'],
title='Product comparison'),
vz.parallel(df_parallel,
dimensions=['latency', 'throughput', 'errors', 'cpu', 'memory'],
title='Multi-dimension profiles'),
], title="Statistical Analysis Dashboard")
chart.to_html()

Choosing the right statistical chart

GoalChart type
Compare distributions across groupsboxplot
Show correlation between two variablesscatter
Highlight data clusterseffect_scatter
Visualize density across 2D gridheatmap
Compare entities across many metricsradar
Explore multi-dimensional patternsparallel