Display options
The display behaviour of Gnuplot.jl depends on the value of the Gnuplot.options.gpviewer boolean option:
if
truethe plot is displayed in a gnuplot window, using one of the interactive terminals such aswxt,qtoraqua. 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 usingGnuplot.options.term;if
falsethe plot is displayed through the Julia multimedia interface, i.e. it is exported as either apng,svgorhtmlfile, 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 inGnuplot.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 isfalse, but if the package is not able to start a gnuplot process it will automatically switch totrue;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 eithersave()orshow()(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. Iftrueall 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.
Settings
This document was generated with Documenter.jl on Saturday 25 April 2020. Using Julia version 1.4.0.
+endAt the Julia prompt you may load the package and the associated settings by typing:
julia> @gnuplotrcand you're ready to go.