Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikerlandson/gnuplot4s
A well typed scala interface to gnuplot
https://github.com/erikerlandson/gnuplot4s
charts gnuplot plotting scala
Last synced: about 2 months ago
JSON representation
A well typed scala interface to gnuplot
- Host: GitHub
- URL: https://github.com/erikerlandson/gnuplot4s
- Owner: erikerlandson
- License: apache-2.0
- Created: 2017-02-19T14:33:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-16T22:26:44.000Z (over 3 years ago)
- Last Synced: 2024-06-13T23:26:55.219Z (7 months ago)
- Topics: charts, gnuplot, plotting, scala
- Language: Scala
- Size: 338 KB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gnuplot4s
A well typed scala interface to gnuplot### Docs
API documentation is [here](https://erikerlandson.github.io/gnuplot4s/latest/api/)### How to use in your project
As of 0.2.0, `gnuplot4s` is published via Sonatype, and so default resolvers will normally be sufficient.
The `gnuplot4s` library is built for Scala 2.12 and 2.13.```scala
libraryDependencies += "com.manyangled" %% "gnuplot4s" % "0.2.0"
```The API for `gnuplot4s` `0.2.0` is identical to `0.1.0`, with the exception that the `cats-free` dependency has been upgraded to `2.6.1`,
and it is no longer compiled for Scala 2.11.### Examples
```scala
scala> import com.manyangled.gnuplot4s._
import com.manyangled.gnuplot4s._scala> val data = Array((0,0), (1,1), (2,2))
data: Array[(Int, Int)] = Array((0,0), (1,1), (2,2))scala> val gnuplot = Session().block("data", data).plot(Plot().block("data").style(PlotStyle.Points)).term(Dumb())
gnuplot: com.manyangled.gnuplot4s.Session = Session(Map(data -> BlockRows()),Dumb(None,None),Console,Options(None,None,None),Vector(Plot((0,1),Points,data)),/usr/bin/gnuplot)scala> gnuplot.render
scala>
2 +-+--------------+-----------------+----------------+--------------+-A
+ + + + +
| $data using 0:1 A |
| |
| |
1.5 +-+ +-+
| |
| |
| |
1 +-+ A +-+
| |
| |
| |
| |
0.5 +-+ +-+
| |
| |
| |
+ + + + +
0 A-+--------------+-----------------+----------------+--------------+-+
0 0.5 1 1.5 2scala> val gnuplot = Session().block("data", data).plot(Plot().block("data").style(PlotStyle.LinesPoints)).term(Dumb())
gnuplot: com.manyangled.gnuplot4s.Session = Session(Map(data -> BlockRows()),Dumb(None,None),Console,Options(None,None,None),Vector(Plot((0,1),LinesPoints,data)),/usr/bin/gnuplot)scala> gnuplot.render
scala>
2 +-+--------------+-----------------+----------------+--------------+*A
+ + + + **** +
| $data using 0:1****A*** |
| **** |
| **** |
1.5 +-+ *** +-+
| **** |
| **** |
| **** |
1 +-+ *A* +-+
| **** |
| *** |
| **** |
| *** |
0.5 +-+ **** +-+
| *** |
| **** |
| *** |
+ **** + + + +
0 A*+--------------+-----------------+----------------+--------------+-+
0 0.5 1 1.5 2
```