You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-22Lines changed: 27 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Gnuplot Elixir
2
2
3
-
A simple interface from [Elixir data][7] to the [Gnuplot graphing utility][1] that uses [Erlang Ports][5] to transmit data from your application to Gnuplot. Datasets are streamed directly to STDIN without temporary files and you can plot [1M points in 20 seconds](examples/stress.exs) on an AWS t2.medium 2 vCPU server.
3
+
A simple interface from [Elixir data][7] to the [Gnuplot graphing utility][1] that uses [Erlang Ports][5] to transmit data from your application to Gnuplot. Datasets are streamed directly to STDIN without temporary files and you can plot [1M points in 12.7 seconds](examples/stress.exs).
4
4
5
5
Please visit the [Gnuplot demos gallery](http://gnuplot.sourceforge.net/demo/) to see all the possibilities, the [manual which describes the grammar](http://www.gnuplot.info/docs_5.2/Gnuplot_5.2.pdf), and the [examples folder](examples/).
6
6
@@ -11,7 +11,7 @@ This is a conversion of the [Clojure Gnuplot library][4] by [aphyr][2].
11
11
The `plot` function takes two arguments:
12
12
13
13
* a list of commands (each of which is a list of terms)
14
-
* a list of datasets (not required when plotting functions)
14
+
* a list of Streams or Enumerable datasets (not required when plotting functions)
15
15
16
16
Commands are lists of terms that normally start with an atom such as `:set`. They may be written as lists or [Word lists](https://elixir-lang.org/getting-started/sigils.html#word-lists) - the following lines are equivalent:
17
17
@@ -44,7 +44,7 @@ Gnuplot will by default open a window containing your plot:
44
44
45
45
### PNG of two datasets
46
46
47
-
Write two datasets to a file:
47
+
Write two datasets to a PNG file:
48
48
49
49
```elixir
50
50
G.plot([
@@ -56,7 +56,7 @@ G.plot([
56
56
G.list(
57
57
["-", :title, "uniform", :with, :points],
58
58
["-", :title, "normal", :with, :points])]
59
-
],
59
+
],
60
60
[
61
61
for(n <-0..200, do: [n, n *:rand.uniform()]),
62
62
for(n <-0..200, do: [n, n *:rand.normal()])
@@ -95,7 +95,7 @@ by adding `gnuplot` to your list of dependencies in `mix.exs`:
95
95
```elixir
96
96
defdepsdo
97
97
[
98
-
{:gnuplot, "~> 0.19.71"}
98
+
{:gnuplot, "~> 0.19.72"}
99
99
]
100
100
end
101
101
```
@@ -110,17 +110,19 @@ Some tests create plots which require `gnuplot` to be installed. They can be be
110
110
111
111
## Performance
112
112
113
-
The performance of the library on a MacBook Air is comparable to the Clojure version when `gnuplot` draws to a GUI. It is a little faster when writing directly to a PNG. It is faster still when running on a server. The times below are in milliseconds. Each plot was made in increasing order of the number of points and after a cold start of the VM.
113
+
The performance of the library on a MacBook Air is comparable to the Clojure version when `gnuplot` draws to a GUI. It is a little faster when writing directly to a PNGwhen running on a server. The times below are in milliseconds. Each plot was made in increasing order of the number of points and after a cold start of the VM. The last two columns show the refactoring from Enumerable to Streams.
0 commit comments