Chart gallery

Every one-call chart type, drawn from simulated data. Each card shows a chart; selecting it opens the section below with the code that drew it and the full-size figure. The examples assume import inklet as i. df is a table of simulated measurements, and each figure names its columns. Options such as width, palette and legend are described in Charts in one call.

Series followed along an axis, with their bands and right-hand scales.

Relationships

Points against points, with fitted lines.

Distributions

The spread of values, as histograms, curves and dots.

Categories and shares

Bars, dots and wedges for counts and totals.

Matrices

Values in a grid of coloured cells.

Studies and survival

Statistics from experiments, trials and cohorts.

Panels

Several charts in one figure, with shared axes or lettered panels.

Series followed along an axis, with their bands and right-hand scales.

Lines with an error band

df has condition, time (h), signal (a.u.) and se (a.u.). The band spans one se (a.u.) either side of each point.

Three signal curves rising from zero over 24 hours and levelling off, the high-dose curve highest, each with a shaded standard-error band

chart = i.line(df, x='time (h)', y='signal (a.u.)', color='condition',
               error_y='se (a.u.)', markers=True)

Names at the line ends

df is the growth table from the first example.

Three signal curves with their names written at the line ends in place of a key

chart = i.line(df, x='time (h)', y='signal (a.u.)', color='condition',
               legend='direct')

Lines on a right-hand axis

df is the generation table from the stacked-area example. secondary_y= puts the named series on a right-hand axis with its own scale.

Gas, hydro and wind generation on the left axis and solar generation on a right-hand axis, from 2010 to 2024

chart = i.line(df, x='year', y='generation (TWh)', color='source',
               secondary_y=['solar'], markers=True)

Stacked areas

df has year, source and generation (TWh). Areas stack unless stacked=False.

Electricity generation from four sources from 2010 to 2024, stacked; wind and solar grow while gas shrinks

chart = i.area(df, x='year', y='generation (TWh)', color='source')

Slope chart

df has year, country and support (%): two time points per country. format= writes the values as percentages.

Support for a policy in four countries in 2015 and in 2025, each country a line with its name and value written at both ends

chart = i.slope(df, x='year', y='support (%)', group='country', format='{:.0f}%')

Relationships

Points against points, with fitted lines.

Scatter with groups

df has strain, dose (mg/kg) and response (%).

Percent response falling as dose rises, for wild-type and mutant strains; the mutant points sit higher at each dose

chart = i.scatter(df, x='dose (mg/kg)', y='response (%)', color='strain')

Scatter coloured by a number

df has temperature (°C), oxygen (mg/L) and chlorophyll (µg/L). A numeric color column with many values is drawn as a ramp.

Dissolved oxygen against temperature for 80 water samples, each point coloured by chlorophyll on a colour ramp with a colour bar

chart = i.scatter(df, x='temperature (°C)', y='oxygen (mg/L)',
                  color='chlorophyll (µg/L)')

Regression with a confidence band

df has concentration (µM) and absorbance (AU), two readings per standard.

Absorbance against concentration for a calibration series, with a fitted line and a shaded 95 per cent confidence band

chart = i.regression(df, x='concentration (µM)', y='absorbance (AU)')

Regression with its equation

df is the calibration table from the regression example. equation=True writes the fitted line on the plot.

Absorbance against concentration for a calibration series, with the fitted line, its confidence band and its equation written on the plot

chart = i.regression(df, x='concentration (µM)', y='absorbance (AU)', equation=True)

Distributions

The spread of values, as histograms, curves and dots.

Overlaid histograms

df has sex and length (mm), one row per specimen.

Histograms of body length for female and male specimens, the male distribution shifted to the right

chart = i.hist(df, x='length (mm)', color='sex', bins=20)

Filled density curves

df has genotype and expression (log2), 80 samples per genotype.

Smoothed density curves of gene expression for wild-type and knockout samples, the knockout curve centred lower

chart = i.kde(df, x='expression (log2)', color='genotype', fill=True)

Cumulative distributions

df has group and latency (ms), 50 animals per group.

Cumulative proportion against latency for sham and treated animals; the treated curve rises earlier

chart = i.ecdf(df, x='latency (ms)', color='group')

Box plots with points

df has treatment and yield (t/ha), 15 plots per treatment.

Crop yield in three treatments as box plots, with each plot drawn as a dot over its box

chart = i.boxplot(df, x='treatment', y='yield (t/ha)', points=True)

Violins

df has cohort and grip force (N), 40 people per cohort.

Violins of grip force for three age cohorts, each shape showing the spread of 40 people; the force falls with age

chart = i.violin(df, x='cohort', y='grip force (N)')

Strip plot

df has site and soil pH.

Soil pH of 20 samples at each of three sites, as jittered dots

chart = i.strip(df, x='site', y='soil pH')

Categories and shares

Bars, dots and wedges for counts and totals.

Bars counting rows

df has one row per specimen in a species column. Without y, a bar counts its rows.

Bars of the number of specimens in each of four species, from the most common to the least

chart = i.bar(df, x='species')

Grouped bars

df has site, season and biomass (g/m2), one row per site and season.

Total biomass at four sites, with side-by-side bars for spring, summer and autumn

chart = i.bar(df, x='site', y='biomass (g/m2)', color='season')

Mean bars with error bars and points

df has group and response (a.u.), one row per animal. agg= takes the mean of each group, and error_y= takes its standard error.

Mean response of control, low-dose and high-dose groups as bars, with standard-error whiskers and a dot for each of the 24 animals in each group

chart = i.bar(df, x='group', y='response (a.u.)', agg='mean',
              error_y='sem', points=True)

Grouped mean bars with error bars and points

df has group, sex and response (a.u.), one row per animal. color= puts the bars side by side, and agg=, error_y= and points= work as they do for a single series.

Mean response of control, low-dose and high-dose groups, with a bar for each sex, standard-error whiskers and a dot for each animal

chart = i.bar(df, x='group', y='response (a.u.)', color='sex', agg='mean',
              error_y='sem', points=True)

Lollipop chart

df has pathway and score, one row per pathway. orient='h' lays the stems across the page.

Enrichment score of five pathways as dots on stems from zero, one row per pathway, with the rows read from the top

chart = i.lollipop(df, x='pathway', y='score', orient='h')

Dumbbell chart

df has site, before (%) and after (%), one row per site. x= names the two value columns.

Soil moisture at four sites before and after a dry season: each site is a line between its two dots, and the legend says which dot is which

chart = i.dumbbell(df, y='site', x=['before (%)', 'after (%)'])

Waterfall chart

df has step and change (k$). The two totals= steps stand from zero; a missing change on a total shows the running total.

A budget from its opening balance to its closing one: sales add, costs and tax take away, and the closing bar is the running total

chart = i.waterfall(df, x='step', y='change (k$)', totals=['Opening', 'Closing'])

Pie chart

df has cell type and cells (n), one row per type. The slices are sized by values=, labelled with their shares, and keyed by names=.

Cell types in one tissue sample as a pie: neurons take just over half of the disc, and the two smallest slices are labelled outside the rim

chart = i.pie(df, names='cell type', values='cells (n)')

Donut chart

df is the cell-type table from the pie chart. hole=0.5 leaves a hole half the radius of the disc.

The same cell types as a donut, with the key at the bottom

chart = i.pie(df, names='cell type', values='cells (n)', hole=0.5, legend='bottom')

Matrices

Values in a grid of coloured cells.

Heatmap with a diverging colour bar

df is a long table with gene, condition and log2 fold change. A diverging palette= with center=0 puts zero at the middle of the colour bar.

Log2 fold change of six genes under four conditions as coloured cells, centred on zero

chart = i.heatmap(df, x='condition', y='gene', z='log2 fold change',
                  palette='rdbu', center=0)

Studies and survival

Statistics from experiments, trials and cohorts.

Volcano plot

df has one row per gene: log2 fold change, a raw p-value and an adjusted fdr. q= classes each point by its adjusted p-value, and highlight= names the genes to label.

Log2 fold change against p-value for 200 genes, the changed genes coloured up or down and two of them named

chart = i.volcano(df, x='log2 fold change', y='p-value', label='gene', q='fdr',
                  highlight=['Il6', 'Cxcl10'])

Forest plot

df has study, odds ratio, lower and upper, one row per study. summary= draws a flagged row as a diamond, and right= lists the text beside the plot: here the estimate with its interval.

Odds ratios from four studies and their pooled estimate, each study a square on a log axis with its interval, the pooled estimate a diamond

chart = i.quick.forest(df, label='study', estimate='odds ratio', lower='lower',
                       upper='upper', summary='pooled', log=True, measure='OR',
                       right=['ci'])

Survival curves

df has arm, months and died. died is 1 where the patient died and 0 where follow-up ended first, which is a censored observation.

Kaplan-Meier survival curves for placebo and drug, the drug curve staying higher, with censor ticks, a confidence band and a number-at-risk table

chart = i.survival(df, time='months', event='died', color='arm')

Panels

Several charts in one figure, with shared axes or lettered panels.

Facet panels

df has cell line, drug, time (h) and viability (%). facet_col= makes one panel per value of a column.

Viability over 24 hours in two panels, one per cell line, with vehicle and two drugs; the panels share axes and one key

chart = i.line(df, x='time (h)', y='viability (%)', color='drug',
               facet_col='cell line')

Combined panels

df is the growth table, and outcomes is the response table. | places panels side by side and / stacks them.

A line plot and a box plot side by side, with a histogram below them, the panels lettered a to c

trace = i.line(df, x='time (h)', y='signal (a.u.)', color='condition',
               error_y='se (a.u.)')
spread = i.boxplot(outcomes, x='group', y='response (a.u.)', points=True)
chart = (trace | spread) / i.hist(outcomes, x='response (a.u.)', color='group', bins=14)

Search documentation

Type to search guides, examples and the API.