https://github.com/aldebap/go-plot
A Golang library that implements GNU-Plot features
https://github.com/aldebap/go-plot
plot plotting
Last synced: about 1 month ago
JSON representation
A Golang library that implements GNU-Plot features
- Host: GitHub
- URL: https://github.com/aldebap/go-plot
- Owner: aldebap
- License: gpl-3.0
- Created: 2022-09-05T01:16:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-02T21:03:31.000Z (about 2 years ago)
- Last Synced: 2025-08-09T21:38:57.277Z (7 months ago)
- Topics: plot, plotting
- Language: Go
- Homepage:
- Size: 1.59 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-plot
[](https://github.com/aldebap/go-plot/actions/workflows/go.yml)
[](https://github.com/aldebap/go-plot/actions/workflows/docker-image.yml)
A Golang library with some Gnuplot features (in progress).
For more info on Gnuplot, visit [Gnuplot](http://gnuplot.info/)
### General features already working
1. Go package to generate plots from multiple sets of points;
2. creation of plots from data files;
3. creation of plots from mathematical functions (in development);
4. graphic drivers to generate the following output formats: SVG, HTML Canvas, GIF, JPEG, PNG;
5. CLI interface to read plot files and generate the graphic output;
### GNU-Plot like commands already working
1. plot command ```set terminal [svg/canvas/gif/jpeg/png]```
2. plot command ```set output "file name"```
3. plot command ```plot "data file" using i:j with [dots/boxes/lines/linespoints/points] title "description"```
4. plot command ```plot [i:j] mathematical function```
5. plot command ```set xlabel "label"```
6. plot command ```set ylabel "label"```
### Additional features already working
1. REST API interface to receive plot commands and generate the graphic output (plot/svg endpoint);
2. REST API interface to receive plot commands and generate the graphic output (plot/canvas endpoint);
3. REST API interface to receive plot commands and generate the graphic output (plot/gif endpoint);
4. REST API interface to receive plot commands and generate the graphic output (plot/jpeg endpoint);
5. REST API interface to receive plot commands and generate the graphic output (plot/png endpoint);
6. Web interface to set plot configuration and generate dynamic plots through the canvas endpoint;
7. Dockerfile to serve Web interface and the REST API interface from a single container;
### Quick start
To simply run the latest version from Github's package, type the following on bash or Powershell:
```sh
docker run -d -p 8080:8080 ghcr.io/aldebap/go-plot
```
Then use your favorite browser to go to the following URI: ```localhost:8080/plot```
### Plot file samples
```gnuplot
set terminal svg
set output "output.svg"
plot "data" using 1:2 with boxes
```

```gnuplot
set terminal svg
set output "output.svg"
plot "data" using 1:2 with lines,
"data" using 1:3
```

```gnuplot
set terminal svg
set output "output.svg"
plot [-4:+4] x * x - 3 * x + 2
```

```gnuplot
set terminal svg
set output "output.svg"
plot [0:6.283184] sin(x)
```

### Features backlog (for v1.0 release)
- [x] ~~Dataset upload button on Web Go-Plot;~~
- [X] ~~Github's Web Go-Plot package;~~
- [X] ~~help on how to run Web Go-Plot from Github's package;~~
- [ ] Webassembly version of Go-Plot for Web;
- [ ] configuration + generic test script;
- [ ] fix bug in multiple plot titles;
- [ ] signed literals in expression parser;
- [ ] assignment operator in function plots;
- [ ] parametric plots;
- [ ] refactor plot file parser;
- [ ] bug in scale evaluation;
- [ ] fix title positioning;
- [ ] rotate y axis for every driver;
- [ ] add more plot styles;
- [ ] add more colors to default pallete;
- [ ] colour pallete command;
- [ ] LaTeX driver;
- [ ] PDF driver;
- [ ] PS driver;