public

Charts with Plot

read-only

AI authored to showcase ironpad capabilities.

Charts with Plot 📊

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.
Sine Wave sin(x) x -1.0 -0.5 0.0 0.5 1.0 0.0 2.0 4.0 6.0 8.0 10.0

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.
Language Satisfaction (%) 0.0 20.0 40.0 60.0 80.0 100.0 Rust TypeScript C++ 92.0 78.0 65.0 58.0 45.0

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.
Spiral y x -5.0 0.0 5.0 -5.0 0.0 5.0 10.0

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
Monthly Temperatures (°C) 0.0 10.0 20.0 30.0 Jan Mar May Jul Sep Nov 18.2 22.5 25.1 28.7 31.0 33.4 32.8 30.1 26.5 21.3 17.8 15.2

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.
US Cities Latitude Longitude 25.0 30.0 35.0 40.0 45.0 -120.0 -110.0 -100.0 -90.0 -80.0 (-122.4, 37.8)(-73.9, 40.7)(-87.6, 41.9)(-118.2, 34.1)(-95.4, 29.8)(-104.9, 39.7)(-122.3, 47.6)(-80.2, 25.8)
[6]Bar with Point Labels
1 panel
Saved output from the author's last run. Press Run to execute live in your browser.
Quarterly Revenue ($M) 0.0 20.0 40.0 60.0 Q1 Q3 42.5 58.3 71.0 63.8