ironpad includes a built-in Plot helper that makes it easy to create charts. Under the hood it uses the plotters crate, but you don't need to set up backends or boilerplate: just call Plot::line, Plot::bar, or Plot::scatter.
All charts render as SVG and follow the notebook theme, so the same chart stays readable in light and dark.
[1]Line Chart
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
Bar Charts
Use Plot::bar with (&str, f64) pairs. Great for categorical data.
[2]Bar Chart Example
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
Scatter Plots
Use Plot::scatter for visualizing point distributions. You can also customize the chart size with .size(width, height).
[3]Scatter Example
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
Combining Plot with Data
Since Plot produces an Svg, you can combine it with data output using tuples. The data flows to the next cell, and the chart displays alongside it.
[4]Plot + Data
2 panels
Saved output from the author's last run. Press Run to execute live in your browser.
Average temperature: 25.2°C
Tooltips & Point Labels
Plot supports two opt-in features for richer charts:
.tooltips(true): adds hover tooltips to each data point (rendered as SVG <title> elements).
.point_labels(true): draws the numeric value directly on each point or bar.
Both are off by default. Try hovering over the scatter points below, or reading the values on the bar chart!
[5]Scatter with Tooltips
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
[6]Bar with Point Labels
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.