GnuplotEx.MultiPlot (gnuplot_ex v0.5.0)
Multi-panel plot composition using gnuplot's multiplot layout.
A %MultiPlot{} holds a list of %GnuplotEx.Plot{} panels rendered together
in a single figure. Each panel retains its own series, title, and axis
settings; the outer MultiPlot controls the terminal, output, overall grid
layout, and optionally a shared x-axis.
Example
panel1 =
GnuplotEx.new()
|> GnuplotEx.title("Price")
|> GnuplotEx.candlestick(ohlc_data)
panel2 =
GnuplotEx.new()
|> GnuplotEx.title("Volume")
|> GnuplotEx.histogram(volume_data)
GnuplotEx.multiplot(layout: {2, 1}, shared_x: true, size: {800, 600})
|> GnuplotEx.add_panel(panel1)
|> GnuplotEx.add_panel(panel2)
|> GnuplotEx.to_png("/tmp/ohlc_stack.png")Fields
:panels— list of%GnuplotEx.Plot{}structs (rendered in order):layout—{rows, cols}; ifnil, defaults to{length(panels), 1}:shared_x— whentrue, a single x-range derived from the panels is emitted outside the multiplot block so every panel inherits it:title— figure-level title emitted onset multiplot layout … title:size—{width, height}for the terminal:terminal— output terminal (set byrender/2,3when called):output— output file path (set byto_svg/2,to_png/2, etc.):background— canvas color appended to theset terminalline (e.g."#0e1116"). Only applied when:terminalis also set.:commands— figure-level raw gnuplot commands emitted once betweenset outputandset multiplot(grid, border, tics, key etc.):row_heights— list of ratios (summing to 1.0 ± 0.001) for unequal vertical panel heights. Mutually exclusive with:layout. When set, emits a bareset multiplotplus per-panelset size/set origininstead ofset multiplot layout R,C.
Summary
Functions
Append a %Plot{} panel.
Append a figure-level raw command (emitted before set multiplot).
Set the layout {rows, cols}.
Build a new multiplot.
Toggle the shared x-axis mode.
Set the figure size {width, height}.
Set the figure-level title.
Types
@type layout() :: {pos_integer(), pos_integer()}
@type t() :: %GnuplotEx.MultiPlot{ background: String.t() | nil, commands: [list()], layout: layout() | nil, output: String.t() | nil, panels: [GnuplotEx.Plot.t()], row_heights: [number()] | nil, shared_x: boolean(), size: {pos_integer(), pos_integer()} | nil, terminal: atom() | nil, title: String.t() | nil }
Functions
@spec add_panel(t(), GnuplotEx.Plot.t()) :: t()
Append a %Plot{} panel.
Append a figure-level raw command (emitted before set multiplot).
Set the layout {rows, cols}.
Build a new multiplot.
Options
:layout—{rows, cols}:shared_x— boolean:title— figure title:size—{width, height}:background— canvas color (appended toset terminalline):commands— figure-level raw commands (list of command lists):row_heights— ratios for unequal panel heights (must sum to 1.0 ± 0.001)
@spec size( t(), {pos_integer(), pos_integer()} ) :: t()
Set the figure size {width, height}.
Set the figure-level title.