GnuplotEx.Plot.Theme (gnuplot_ex v0.5.0)

Theme configuration for consistent plot styling.

Themes provide a way to apply consistent styling across plots. Use preset themes or create custom ones.

Preset Themes

  • :default - Minimal theme with grid
  • :dark - Dark background with light text
  • :exdoc - Matches ExDoc dark mode colors
  • :publication - Clean style suitable for publications

Example

# Use preset
GnuplotEx.new()
|> GnuplotEx.theme(:dark)
|> GnuplotEx.scatter(data)
|> GnuplotEx.to_svg("/tmp/plot.svg")

# Custom theme
theme = %GnuplotEx.Plot.Theme{
  background: "#f5f5f5",
  grid: true,
  palette: ["#E95420", "#3daee9", "#27ae60"]
}

GnuplotEx.new()
|> GnuplotEx.theme(theme)
|> GnuplotEx.scatter(data)

Summary

Functions

Dark theme with dark background and light text.

Default minimal theme with grid.

ExDoc dark theme.

Get a preset theme by name.

Publication-ready theme.

Convert theme to gnuplot commands.

Types

t()

@type t() :: %GnuplotEx.Plot.Theme{
  background: String.t() | nil,
  border_color: String.t() | nil,
  commands: [list()],
  font: String.t() | nil,
  font_size: pos_integer() | nil,
  grid: boolean() | keyword() | nil,
  name: atom() | nil,
  palette: atom() | [String.t()] | GnuplotEx.Plot.Palette.t() | nil,
  text_color: String.t() | nil
}

Functions

dark()

@spec dark() :: t()

Dark theme with dark background and light text.

Good for presentations and dashboards. WCAG 2.1 AA compliant (4.5:1+ contrast ratio).

default()

@spec default() :: t()

Default minimal theme with grid.

exdoc()

@spec exdoc() :: t()

ExDoc dark theme.

Matches ExDoc's dark mode colors for seamless documentation integration. WCAG 2.1 AA compliant (4.5:1+ contrast ratio).

get(arg1)

@spec get(atom()) :: t()

Get a preset theme by name.

Presets

  • :default - Minimal styling with grid enabled
  • :dark - Dark background suitable for presentations
  • :exdoc - Matches ExDoc dark mode for documentation
  • :publication - Clean black-and-white style for papers

Example

theme = GnuplotEx.Plot.Theme.get(:dark)

publication()

@spec publication() :: t()

Publication-ready theme.

Clean black-and-white style suitable for academic papers.

to_commands(name)

@spec to_commands(t() | atom() | nil) :: [list()]

Convert theme to gnuplot commands.

Returns a list of gnuplot command lists.