GnuplotEx.Dataset protocol (gnuplot_ex v0.5.0)

Protocol for formatting data for gnuplot transmission.

Implement this protocol for custom data types to enable direct plotting.

Built-in Implementations

  • List - formats as inline text data

Example

defimpl GnuplotEx.Dataset, for: MyCustomDataFrame do
  def format(df, opts) do
    df
    |> MyCustomDataFrame.to_rows()
    |> GnuplotEx.Dataset.Helpers.format_text()
  end
end

Summary

Types

t()

All the types that implement this protocol.

Functions

Format data for gnuplot transmission.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

format(data, opts \\ [])

@spec format(
  t(),
  keyword()
) :: Enumerable.t()

Format data for gnuplot transmission.

Returns a Stream of strings to be sent to gnuplot's stdin.

Options

  • :mode - :text (default) or :binary (future)