From 78019eba5f8338291c739145e9f6ec5ae7d0926c Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Sat, 25 Apr 2020 20:42:37 +0200 Subject: [PATCH] Docs updated --- v1.3.0/options/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v1.3.0/options/index.html b/v1.3.0/options/index.html index 3c42f03..d321e76 100644 --- a/v1.3.0/options/index.html +++ b/v1.3.0/options/index.html @@ -1,5 +1,5 @@ -Package options · Gnuplot.jl

Display options

The display behaviour of Gnuplot.jl depends on the value of the Gnuplot.options.gpviewer boolean option:

  • if true the plot is displayed in a gnuplot window, using one of the interactive terminals such as wxt, qt or aqua. There is exactly one window for each session, and the plots are updated by replacing the displayed image. The preferred terminal can optionally be set using Gnuplot.options.term;

  • if false the plot is displayed through the Julia multimedia interface, i.e. it is exported as either a png, svg or html file, and displayed in an external viewer. In this case the package is unable to replace a previous plot, hence each update results in a separate image being displayed. The terminal options to export the images are set in Gnuplot.options.mime.

The latter approach can only be used when running a Jupyter, JupyterLab or Juno session, while the former approach is appropriate in all cases (most notably, for the standard Julia REPL). The Gnuplot.options.gpviewer flag is automatically set when the package is first loaded according to the runtime environment, however the user can change its value at any time to fit specific needs.

Further informations and examples for both options are available in this Jupyter notebook.

Package options and initialization

Options

The package options are stored in a global structure available in Julia as Gnuplot.option (the type of the structure is Gnuplot.Options). The most important settings are as follows:

  • dry::Bool: if true all new sessions will be started as Dry sessions. Default is false, but if the package is not able to start a gnuplot process it will automatically switch to true;

  • cmd::String: command to start the gnuplot process, default value is "gnuplot". Use this field to specify a custom path to the gnuplot executable;

  • term::String: default terminal for interactive use (default is an empty string, i.e. use gnuplot settings). A custom terminal can be set with, e.g.:

julia> Gnuplot.options.term = "wxt size 700,400";
  • mime::Dict{MIME, String}: dictionary of MIME types and corresponding gnuplot terminals. Used to export images with either save() or show() (see Display options);

  • init::Vector{String}: commands to initialize the session when it is created or reset. It can be used to, e.g., set a custom linetypes or palette:

julia> push!(Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5));

Note that this option affect all the sessions, and that all inserted commands are saved in Gnuplot scripts;

  • verbose::Bool: a flag to set verbosity of the package. If true all communication with the underlying process will be printed on stdout. E.g.:

+Package options · Gnuplot.jl

Display options

The display behaviour of Gnuplot.jl depends on the value of the Gnuplot.options.gpviewer boolean option:

  • if true the plot is displayed in a gnuplot window, using one of the interactive terminals such as wxt, qt or aqua. There is exactly one window for each session, and the plots are updated by replacing the displayed image. The preferred terminal can optionally be set using Gnuplot.options.term;

  • if false the plot is displayed through the Julia multimedia interface, i.e. it is exported as either a png, svg or html file, and displayed in an external viewer. In this case the package is unable to replace a previous plot, hence each update results in a separate image being displayed. The terminal options to export the images are set in Gnuplot.options.mime.

The latter approach can only be used when running a Jupyter, JupyterLab or Juno session, while the former approach is appropriate in all cases (most notably, for the standard Julia REPL). The Gnuplot.options.gpviewer flag is automatically set when the package is first loaded according to the runtime environment, however the user can change its value at any time to fit specific needs.

Further informations and examples for both options are available in this Jupyter notebook.

Package options and initialization

Options

The package options are stored in a global structure available in Julia as Gnuplot.option (the type of the structure is Gnuplot.Options). The most important settings are as follows:

  • dry::Bool: if true all new sessions will be started as Dry sessions. Default is false, but if the package is not able to start a gnuplot process it will automatically switch to true;

  • cmd::String: command to start the gnuplot process, default value is "gnuplot". Use this field to specify a custom path to the gnuplot executable;

  • gpviewer::Bool: use a gnuplot terminal as main plotting device (if true) or an external viewer (if false);

  • term::String: default terminal for interactive use (default is an empty string, i.e. use gnuplot settings). A custom terminal can be set with, e.g.:

julia> Gnuplot.options.term = "wxt size 700,400";
  • mime::Dict{MIME, String}: dictionary of MIME types and corresponding gnuplot terminals. Used to export images with either save() or show() (see Display options). Default values are:
    • MIME"application/pdf" => "pdfcairo enhanced"
    • MIME"image/jpeg" => "jpeg enhanced"
    • MIME"image/png" => "pngcairo enhanced"
    • MIME"image/svg+xml" => "svg enhanced mouse standalone dynamic background rgb 'white'"
    • MIME"text/html" => "svg enhanced mouse standalone dynamic"
    • MIME"text/plain" => "dumb enhanced ansi"
  • init::Vector{String}: commands to initialize the session when it is created or reset. It can be used to, e.g., set a custom linetypes or palette:
julia> push!(Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5));

Note that this option affect all the sessions, and that all inserted commands are saved in Gnuplot scripts;

  • verbose::Bool: a flag to set verbosity of the package. If true all communication with the underlying process will be printed on stdout. E.g.:

 
 julia> Gnuplot.options.verbose = true;
 
@@ -81,4 +81,4 @@ ERROR: type Options has no field term_svg

julia> @gnuplotrc

and you're ready to go.

+end

At the Julia prompt you may load the package and the associated settings by typing:

julia> @gnuplotrc

and you're ready to go.