tiny-plot ~main

Tiny plotting library built on tiny-svg


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

<img src="imgs/logo.png" width="95" height="52" align="left"></img>

Tiny Plot

A tiny plotting library for D, built on tiny-svg. Supports line plots, scatter plots, bar charts, histograms, and pie charts.

Library

Add library to your project using DUB:

dub add tiny-plot

Quick Start

import rk.tplot;

auto p = Plot(800, 500);

double[] x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
double[] y = [2.3, 4.1, 3.5, 6.2, 5.8, 7.1, 8.3, 7.9, 9.2, 10.1];

p.plot(x, y, "Temperature");
p.setTitle("Line Plot Example");
p.setXLabel("Day");
p.setYLabel("Value");
p.save("line_plot.svg");

Features

All chart types are methods on a single Plot struct:

MethodDescription
p.plot(x, y, name)Line plot
p.scatter(x, y, name)Scatter plot
p.bar(x, y, name)Bar chart
p.hist(data, numBins, name)Histogram
p.pie(values, names)Pie chart

Additional methods:

  • p.setTitle(title) — set plot title
  • p.setXLabel(label) / p.setYLabel(label) — set axis labels
  • p.setStyle(style) — customize plot appearance
  • p.save(filename) — render and save to SVG

Multiple series can be combined on the same plot:

auto p = Plot(900, 600);

p.bar(x, bars, "Volume");
p.plot(x, trend, "Trend");
p.scatter(x, actual, "Actual");
p.setTitle("Combined Plot");
p.save("combined_plot.svg");

Examples

Line Plot

<img src="examples/line_plot.svg" width="720">

Scatter Plot

<img src="examples/scatter_plot.svg" width="720">

Bar Chart

<img src="examples/bar_chart.svg" width="720">

Histogram

<img src="examples/histogram.svg" width="720">

Pie Chart

<img src="examples/pie_chart.svg" width="720">

Combined Plot

<img src="examples/combined_plot.svg" width="720">

Code can be found here.

LICENSE

All code is licensed under the MIT license.

Authors:
  • rillki
Dependencies:
tiny-svg
Versions:
1.0.1 2026-Apr-04
1.0.0 2026-Apr-04
~main 2026-Apr-04
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 2 downloads this month

  • 7 downloads total

Score:
0.0
Short URL:
tiny-plot.dub.pm