ViewX logoViewX

Charts — vx.plot()

v0.3.0

One call for every chart: 14 kinds, interactive (Plotly) or static (matplotlib), with automatic kind inference from dtypes, downsampling for large datasets and WebGL acceleration.

Basic Usage

Pass a DataFrame and the aesthetics. When kind is omitted, ViewX infers the best chart type from the column dtypes. The returned Chart object exposes .save(), .show() and the underlying figure in .fig.

charts.py
import viewx as vx

df = vx.load_dataset("iris.csv")

# Interactive (Plotly) — renders itself in notebooks
vx.plot(df, x="sepal_length", y="petal_length", title="Sepal vs Petal")

# Kind inferred from dtypes: categorical x + numeric y -> bar
vx.plot(df, x="species", y="petal_length")

# Static (matplotlib) for papers / PDFs
vx.plot(df, kind="histogram", x="sepal_length", static=True).save("hist.png")

Available Kinds

KindUse case
lineTrends over an ordered axis (dates, indexes)
barCategorical comparisons (vertical)
bar_hCategorical comparisons (horizontal)
scatterRelationship between two numeric variables
areaCumulative trends over an ordered axis
pieProportions of a whole
donutProportions of a whole (ring)
histogramDistribution of one numeric variable
boxDistribution groups with quartiles/outliers
violinDistribution groups with density
heatmapMatrix values (correlations, pivots)
funnelStage-to-stage drop-off
treemapHierarchical proportions
bubbleScatter weighted by size

API Reference

plot
plot(data, kind=None, x=None, y=None, z=None, static=False, title=None, **kwargs) -> Chart
Chart.save
chart.save(path, **kwargs)
Chart.show
chart.show()

Large Datasets

vx.plot is built for real-world data sizes:

Downsampling — datasets over 10k points are sampled before rendering so the browser stays fast.

WebGL — scatter charts over 5k points automatically switch to WebGL rendering (scattergl).