gnuplot v0.19.71 Gnuplot View Source

Interface to the Gnuplot graphing library.

Plot a sine wave:

Gnuplot.plot([
  ~w(set autoscale)a,
  ~w(set samples 800)a,
  [:plot, -30..20, 'sin(x*20)*atan(x)']
])

Link to this section Summary

Functions

Find the gnuplot executable

Build a comma separated list

Plot a function that has no dataset

Transmit commands and data streams to gnuplot

Link to this section Functions

Link to this function

gnuplot_bin() View Source
gnuplot_bin() :: {:error, :gnuplot_missing} | {:ok, :file.name()}

Find the gnuplot executable.

Build a comma separated list.

Link to this function

plot(commands) View Source
plot([term()]) :: {:ok, String.t()} | {:error, term()}

Plot a function that has no dataset.

Link to this function

plot(commands, datasets) View Source
plot([term()], [Dataset.t()]) :: {:ok, String.t()} | {:error, term()}

Transmit commands and data streams to gnuplot.

Examples

iex> Gnuplot.plot([[:plot, "-", :with, :lines]], [[[0, 0], [1, 2], [2, 4]]])
{:ok, "..."}