pnezis
Tucan - a plotting library on top of VegaLite
Tucan is an Elixir plotting library built on top of VegaLite designed to simplify the creation of interactive and visually stunning plots. With Tucan you can effortlessly generate a wide range of plots, from simple bar charts to complex composite plots, all while enjoying the power and flexibility of a clean composable functional API. Version 0.1.1 was just released ![]()
You can find the docs here.
Sample usage:
scatter =
Tucan.scatter(:iris, "petal_width", "petal_length", tooltip: true)
|> Tucan.color_by("species")
|> Tucan.shape_by("species")
lines = Tucan.lineplot(:stocks, "date", "price", color_by: "symbol", x: [type: :temporal])
area =
Tucan.area(:stocks, "date", "price", color_by: "symbol", mode: :normalize, x: [type: :temporal])
density = Tucan.density(:penguins, "Body Mass (g)", color_by: "Species", fill_opacity: 0.2)
strip =
Tucan.stripplot(:tips, "total_bill", group: "day", style: :jitter)
|> Tucan.color_by("sex")
boxplot = Tucan.boxplot(:penguins, "Body Mass (g)", color_by: "Species")
histogram = Tucan.histogram(:cars, "Horsepower", color_by: "Origin", fill_opacity: 0.5)
pie = Tucan.pie(:barley, "yield", "site", aggregate: :sum, tooltip: true)
donut = Tucan.donut(:barley, "yield", "site", aggregate: :sum, tooltip: true)
heatmap =
Tucan.density_heatmap(:penguins, "Beak Length (mm)", "Beak Depth (mm)", fill_opacity: 1.0)
Tucan.vconcat([
Tucan.hconcat([scatter, lines, area]),
Tucan.hconcat([density, Tucan.vconcat([strip, boxplot]), histogram]),
Tucan.hconcat([pie, donut, heatmap])
])
will generate the following:
Credits go to @jonatanklosko for the awesome VegaLite bindings.
Most Liked
pnezis
New version released today: v0.2.0, with many new features:
- heatmap, punchcard and jointplot plots
- vruler and hruler for adding vertical/horizontal rulers on any plot
- Helper modules for configuring the Legend and the Scale
- Docs improvements, added a livebook guide
You can find the full CHANGELOG here
Any feedback welcome
josevalim
The new (and old) plots are great!
pnezis
v0.3.0 is out. It includes many new features and enhancements:
- Nx support, you can pass directly tensors as series to all plots
- imshow allows you to plot pseudo-color images
- errorbar and errorband plots added
- lollipop plot added as an alternative to bar chart
- Tucan.Geometry module provides an API for plotting common geometric shapes and polylines
You can find the full CHANGELOG here
Happy new year!
jonatanklosko
pnezis
@josevalim heatmap/5 added
Will release a new version later this week









