gnuplot v0.19.87 Gnuplot View Source

Interface to the Gnuplot graphing library.

Plot a sine function where Gnuplot generates the samples:

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

Plot a sine function where your program generates the data:

Gnuplot.plot([
    [:plot, "-", :with, :lines :title, "sin(x*20)*atan(x)"]
  ],
  [
    for x <- -30_000..20_000, do: [x / 1000.0 , :math.sin(x * 20 / 1000.0) * :math.atan(x / 1000.0) ]
  ]
)

Link to this section Summary

Functions

Build a comma separated list from a list of terms

Build a comma separated list of two terms

Build a comma separated list of three terms

Build a comma separated list of four terms

Build a comma separated list of five terms

Build a comma separated list of six terms

Transmit commands without dataset

Transmit commands and datasets to Gnuplot

Link to this section Types

Link to this type

command() View Source
command() :: [command_term(), ...]

Link to this type

command_term() View Source
command_term() :: atom() | charlist() | number() | Range.t() | String.t()

Link to this section Functions

Build a comma separated list from a list of terms.

Build a comma separated list of two terms.

Build a comma separated list of three terms.

Build a comma separated list of four terms.

Build a comma separated list of five terms.

Build a comma separated list of six terms.

Link to this function

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

Transmit commands without dataset.

Link to this function

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

Transmit commands and datasets to Gnuplot.

Examples

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