Skip to content

Commit e02bbdb

Browse files
committed
Gnuplot v5.3
1 parent af6cc5c commit e02bbdb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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).
44

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/).
5+
Please visit the [Gnuplot demos gallery](http://gnuplot.sourceforge.net/demo_5.3/) 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/).
66

77
This is a conversion of the [Clojure Gnuplot library][4] by [aphyr][2]. This library can also be [called from Erlang](docs/erlang.md) and has been tested on OS X, Ubuntu 16.04 and CentOS 7.6.
88

@@ -34,10 +34,8 @@ A dataset is a list of points, each point is a list of numbers. A dataset can be
3434
Lets compare the distributions of the [Erlang rand functions](http://erlang.org/doc/man/rand.html):
3535

3636
```elixir
37-
alias Gnuplot, as: G
38-
3937
dataset = for _ <- 0..1000, do: [:rand.uniform(), :rand.normal()]
40-
{:ok, _cmd} = G.plot([
38+
{:ok, _cmd} = Gnuplot.plot([
4139
[:set, :title, "rand uniform vs normal"],
4240
[:plot, "-", :with, :points]
4341
], [dataset])
@@ -54,6 +52,8 @@ The command string sent (`_cmd` above) can be manually inspected should the char
5452
Write two datasets to a PNG file:
5553

5654
```elixir
55+
alias Gnuplot, as: G
56+
5757
{:ok, _cmd} = G.plot([
5858
[:set, :term, :png],
5959
[:set, :output, "/tmp/rand.png"]
@@ -78,13 +78,13 @@ NB When we are plotting multiple datasets in the same plot we need a comma separ
7878
### Plot functions without datasets
7979

8080
```elixir
81-
G.plot([[:plot, 'sin(x)', :title, "Sine Wave"]])
81+
Gnuplot.plot([[:plot, 'sin(x)', :title, "Sine Wave"]])
8282
```
8383

8484
![rand](docs/sine.PNG)
8585

8686
```elixir
87-
G.plot([
87+
Gnuplot.plot([
8888
~w(set autoscale)a,
8989
~w(set samples 800)a,
9090
[:plot, -30..20, 'sin(x*20)*atan(x)']
@@ -143,7 +143,7 @@ ubuntu_t2m = [0.004, 0.002, 0.001, 0.008, 0.211, 1.873, 19.916]
143143
ubuntu_stream = [0.002, 0.001, 0.001, 0.009, 0.204, 1.279, 12.858]
144144
datasets = for ds <- [clojure_gui, elixir_gui, elixir_png, ubuntu_t2m, ubuntu_stream], do: Enum.zip (points, ds)
145145

146-
G.plot([
146+
Gnuplot.plot([
147147
[:set, :title, "Time to render scatter plots"],
148148
[:set, :xlabel, "Points in plot"],
149149
[:set, :ylabel, "Elapsed (s)"],
@@ -155,7 +155,7 @@ G.plot([
155155
~w(set style line 3 lw 2 lc '#5E2750')a,
156156
~w(set style line 4 lw 2 lc '#E95420')a,
157157
~w(set style line 5 lw 4 lc '#77216F')a,
158-
[:plot, G.list(
158+
[:plot, Gnuplot.list(
159159
["-", :title, "Clojure GUI", :with, :lines, :ls, 1],
160160
["-", :title, "Elixir GUI", :with, :lines, :ls, 2],
161161
["-", :title, "Elixir PNG", :with, :lines, :ls, 3],

0 commit comments

Comments
 (0)