GnuplotEx.Plot.Series (gnuplot_ex v0.2.0)

Represents a single data series in a plot.

Series are added to plots via GnuplotEx.scatter/2,3, GnuplotEx.line/2,3, GnuplotEx.histogram/2,3, GnuplotEx.spider/2,3, GnuplotEx.parallel/2,3, GnuplotEx.pie/2,3, and GnuplotEx.donut/2,3.

Fields

  • :data - The dataset (list, stream, or any Dataset-implementing type)
  • :type - Plot type (:scatter, :line, :histogram, :scatter3d, :surface, etc.)
  • :label - Legend label
  • :color - Color string like "#E95420" or named color
  • :line_width - Line width for line plots
  • :point_type - Point type for scatter (1-14 or atom)
  • :point_size - Point size multiplier
  • :fill - Fill style for histograms
  • :using - Raw gnuplot "using" clause
  • :opts - Additional options passed to gnuplot

3D-specific Fields

  • :surface_style - Surface rendering style (:pm3d, :lines, :hidden3d)
  • :u_range - U parameter range for parametric surfaces
  • :v_range - V parameter range for parametric surfaces
  • :samples - Grid resolution for surfaces {x_samples, y_samples}
  • :contour_levels - Number of contour levels
  • :contour_style - Contour plot style (:base, :surface, :both)
  • :function - Function for function-based plots

Spider-specific Fields

  • :axes - List of axis names for spider/radar charts
  • :filled - Fill the spider polygon area (boolean)
  • :alpha - Fill transparency 0.0-1.0 for spider charts

Parallel Coordinates Fields

  • :axes - List of axis names (shared with spider charts)

Pie/Donut Chart Fields

  • :labels - List of slice labels
  • :colors - List of colors or palette name for slices
  • :explode - List of slice indices to explode (offset outward)
  • :inner_radius - Inner radius ratio 0.0-1.0 for donut charts
  • :start_angle - Starting angle in degrees (0 = top, clockwise)

Polygon Fields

  • :border_color - Border line color for polygons
  • :border_width - Border line width for polygons

Binary Mode

  • :binary - Use binary data format for faster transmission (default: false)

Summary

Functions

Create a new series with the given type and data.

Types

plot_type()

@type plot_type() ::
  :scatter
  | :line
  | :histogram
  | :bar
  | :impulses
  | :steps
  | :boxes
  | :scatter3d
  | :surface
  | :parametric
  | :contour
  | :wireframe
  | :spider
  | :parallel
  | :pie
  | :donut
  | :polygon
  | :polygon3d

t()

@type t() :: %GnuplotEx.Plot.Series{
  alpha: number() | nil,
  axes: [atom() | String.t()] | nil,
  binary: boolean(),
  bins: pos_integer() | nil,
  border_color: String.t() | nil,
  border_width: number() | nil,
  color: String.t() | nil,
  colors: [String.t()] | atom() | nil,
  contour_levels: pos_integer() | nil,
  contour_style: :base | :surface | :both | nil,
  data: Enumerable.t() | nil,
  explode: [non_neg_integer()] | nil,
  fill: atom() | String.t() | nil,
  filled: boolean() | nil,
  function: fun() | nil,
  inner_radius: number() | nil,
  label: String.t() | nil,
  labels: [String.t()] | nil,
  line_width: pos_integer() | nil,
  opts: keyword(),
  point_size: number() | nil,
  point_type: atom() | pos_integer() | nil,
  samples: {pos_integer(), pos_integer()} | pos_integer() | nil,
  smooth: atom() | nil,
  start_angle: number() | nil,
  surface_style: :pm3d | :lines | :hidden3d | nil,
  type: plot_type(),
  u_range: Range.t() | {number(), number()} | nil,
  using: String.t() | nil,
  v_range: Range.t() | {number(), number()} | nil
}

Functions

new(type, data_or_fn, opts \\ [])

@spec new(plot_type(), Enumerable.t() | fun() | nil, keyword()) :: t()

Create a new series with the given type and data.

Example

Series.new(:scatter, data, label: "Points", color: "#E95420")
Series.new(:scatter3d, data, label: "3D Points")
Series.new(:surface, data, surface_style: :pm3d)