From 519731e4dd91d9a957e8cf6ce3af9b1365c96e01 Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Thu, 16 Apr 2020 14:16:01 +0200 Subject: [PATCH] Docs updated --- docs/src/advanced.md | 2 +- docs/src/api.md | 5 +++++ docs/src/basic.md | 4 ++-- docs/src/options.md | 8 ++++---- docs/src/recipes.md | 2 +- src/Gnuplot.jl | 6 +++--- src/recipes.jl | 3 +++ 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/src/advanced.md b/docs/src/advanced.md index f9d5366..fa3bc40 100644 --- a/docs/src/advanced.md +++ b/docs/src/advanced.md @@ -6,7 +6,7 @@ mkpath("assets") empty!(Gnuplot.options.init) push!( Gnuplot.options.init, "set term unknown") empty!(Gnuplot.options.reset) -push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)) +push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5, ps=1.5)) saveas(file) = save(term="pngcairo size 550,350 fontscale 0.8", output="assets/$(file).png") ``` diff --git a/docs/src/api.md b/docs/src/api.md index a5b1942..b7f2dc7 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -14,10 +14,14 @@ boxxyerror contourlines dataset_names gpexec +gpmargins +gpranges +gpvars hist linetypes palette palette_names +recipe save session_names stats @@ -41,5 +45,6 @@ Gnuplot.Path2d Gnuplot.gpversion Gnuplot.quit Gnuplot.quitall +Gnuplot.repl_init Gnuplot.version ``` diff --git a/docs/src/basic.md b/docs/src/basic.md index 61b94f1..faab35b 100644 --- a/docs/src/basic.md +++ b/docs/src/basic.md @@ -6,7 +6,7 @@ Gnuplot.splash("assets/logo.png") empty!(Gnuplot.options.init) push!( Gnuplot.options.init, "set term unknown") empty!(Gnuplot.options.reset) -push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)) +push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5, ps=1.5)) saveas(file) = save(term="pngcairo size 550,350 fontscale 0.8", output="assets/$(file).png") ``` @@ -239,7 +239,7 @@ The first plot features the `:Set1_5` palette, with solid lines whose width is 2 As discussed in [Options](@ref), you may set a default line types for all plots with: ```julia -push!(Gnuplot.options.init, linetypes(:Set1_5, lw=2)) +push!(Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5)) ``` All plot in this documentation were generated with these settings. diff --git a/docs/src/options.md b/docs/src/options.md index a2bccc2..c52a530 100644 --- a/docs/src/options.md +++ b/docs/src/options.md @@ -6,7 +6,7 @@ mkpath("assets") empty!(Gnuplot.options.init) push!( Gnuplot.options.init, "set term unknown") empty!(Gnuplot.options.reset) -push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)) +push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5, ps=1.5)) saveas(file) = save(term="pngcairo size 550,350 fontscale 0.8", output="assets/$(file).png") ``` @@ -25,7 +25,7 @@ Note that this is option affect all the newly created sessions, not the older on - `reset::Vector{String}`: initialization commands to be executed when a session is reset. Default is an empty vector. It can be used to, e.g., set custom linetypes or palette: ```@repl abc -push!(Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)); +push!(Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5, ps=1.5)); ``` Note that this is option affect all the sessions. Also note that the commands in `Gnuplot.options.reset` **are** saved in [Gnuplot scripts](@ref); @@ -38,8 +38,8 @@ x = 1.:10; @gp x x.^2 "w l t 'Parabola'" save(term="pngcairo size 480,360 fontscale 0.8", output="output.png") Gnuplot.options.verbose = false # hide -push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)); # hide -gpexec("set term unknown"); # hide +push!(Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)); # hide +gpexec("set term unknown"); # hide ``` Each line reports the package name (`GNUPLOT`), the session name (`default`), the command or string being sent to gnuplot process, and the returned response (line starting with `->`). Default value is `false`; diff --git a/docs/src/recipes.md b/docs/src/recipes.md index 133f5fa..e6cf0f9 100644 --- a/docs/src/recipes.md +++ b/docs/src/recipes.md @@ -6,7 +6,7 @@ mkpath("assets") empty!(Gnuplot.options.init) push!( Gnuplot.options.init, "set term unknown") empty!(Gnuplot.options.reset) -push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5)) +push!( Gnuplot.options.reset, linetypes(:Set1_5, lw=1.5, ps=1.5)) saveas(file) = save(term="pngcairo size 550,350 fontscale 0.8", output="assets/$(file).png") ``` diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 658350b..ef954a1 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -1911,8 +1911,8 @@ end # ╰───────────────────────────────────────────────────────────────────╯ # -------------------------------------------------------------------- """ - gpvars() gpvars(sid::Symbol) + gpvars() Return a `Dict{Symbol, Union{String, Real}}` with all currently defined gnuplot variables. If the `sid` argument is not provided, the default session is considered. """ @@ -1945,8 +1945,8 @@ end # -------------------------------------------------------------------- """ - gpmargins() gpmargins(sid::Symbol) + gpmargins() Return a `NamedTuple` with keys `l`, `r`, `b` and `t` containing respectively the left, rigth, bottom and top margins of the current plot (in screen coordinates). """ @@ -1961,8 +1961,8 @@ function gpmargins(sid::Symbol) end """ - gpranges() gpranges(sid::Symbol) + gpranges() Return a `NamedTuple` with keys `x`, `y`, `z` and `cb` containing respectively the current plot ranges for the X, Y, Z and color box axis. """ diff --git a/src/recipes.jl b/src/recipes.jl index ea1c60d..ac5bcea 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -4,6 +4,9 @@ # -------------------------------------------------------------------- # Histograms +""" + recipe() +""" recipe(h::Histogram1D) = PlotElement(cmds="set grid", data=DatasetText(h.bins, h.counts),