diff --git a/docs/src/api.md b/docs/src/api.md index 83a458b..3b79e23 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -30,6 +30,7 @@ In order to call these functions you should add the `Gnuplot.` prefix to the fun Gnuplot.Histogram1D Gnuplot.Histogram2D Gnuplot.IsoContourLines +Gnuplot.Options Gnuplot.Path2d Gnuplot.exec Gnuplot.gpversion diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 496650a..2dde894 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -47,15 +47,27 @@ end # --------------------------------------------------------------------- +""" + Options + +Structure containing the package global options, accessible through `Gnuplot.options`. + +# Fields +- `dry::Bool`: whether to use *dry* sessions, i.e. without an underlying Gnuplot process (default: `false`) +- `cmd::String`: command to start the Gnuplot process (default: `"gnuplot"`) +- `default::Symbol`: default session name (default: `:default`) +- `init::Vector{String}`: commands to initialize the gnuplot session (e.g., to set default terminal) +- `verbose::Bool`: verbosity flag (default: `false`) +""" Base.@kwdef mutable struct Options - dry::Bool = false # Use "dry" sessions (i.e. without an underlying Gnuplot process) - cmd::String = "gnuplot" # Customizable command to start the Gnuplot process - default::Symbol = :default # Default session name - init::Vector{String} = Vector{String}() # Commands to initialize the gnuplot session (e.g., to set default terminal) - verbose::Bool = false # verbosity flag (true/false) - datalines::Int = 4; # How many lines of a dataset are printed in log + dry::Bool = false + cmd::String = "gnuplot" + default::Symbol = :default + init::Vector{String} = Vector{String}() + verbose::Bool = false end + # ╭───────────────────────────────────────────────────────────────────╮ # │ GLOBAL VARIABLES │ # ╰───────────────────────────────────────────────────────────────────╯