tiny-plot 1.0.0
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:
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:
| Method | Description |
|---|---|
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 titlep.setXLabel(label)/p.setYLabel(label)— set axis labelsp.setStyle(style)— customize plot appearancep.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.
- 1.0.0 released a month ago
- kirillsaidov/tiny-plot
- BSL
- Copyright © 2026, rillki
- Authors:
- Dependencies:
- tiny-svg
- Versions:
-
Show all 3 versions1.0.1 2026-Apr-04 1.0.0 2026-Apr-04 ~main 2026-Apr-04 - 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