Minor changes

This commit is contained in:
Giorgio Calderone 2018-01-14 00:45:49 +01:00
parent 654e4bdb0b
commit 1665b78a54
3 changed files with 8 additions and 2 deletions

View File

@ -221,7 +221,7 @@ m = a * sin.(b + c * x)
gp.session() gp.session()
# Plot again using the @gp macro. # Plot again using the @gp macro.
title = "Fit param: " * @sprintf("a=%5.2f, b=%5.2f, c=%5.2f", a, b ,c), title = "Fit param: " * @sprintf("a=%5.2f, b=%5.2f, c=%5.2f", a, b ,c)
@gp("set key horizontal", "set grid", @gp("set key horizontal", "set grid",
:multi, "layout 2,1", :multi, "layout 2,1",
title=title, ylab="Y label", title=title, ylab="Y label",

View File

@ -1,3 +1,5 @@
isdefined(Base, :__precompile__) && __precompile__()
module Gnuplot module Gnuplot
using AbbrvKW using AbbrvKW
@ -739,6 +741,8 @@ macro gpi(args...)
if isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :reset) if isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :reset)
push!(exprBlock.args, :(Gnuplot.reset())) push!(exprBlock.args, :(Gnuplot.reset()))
elseif isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :dump)
push!(exprBlock.args, :(Gnuplot.dump()))
elseif isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :plot) elseif isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :plot)
pendingPlot = true pendingPlot = true
elseif isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :multi) elseif isa(arg, Expr) && (arg.head == :quote) && (arg.args[1] == :multi)

View File

@ -1,3 +1,5 @@
isdefined(Base, :__precompile__) && __precompile__()
###################################################################### ######################################################################
# MODULE GnuplotInternals (private functions and definitions) # MODULE GnuplotInternals (private functions and definitions)
###################################################################### ######################################################################
@ -89,7 +91,7 @@ mutable struct MainState
handles::Vector{Int} # handles of gnuplot sessions handles::Vector{Int} # handles of gnuplot sessions
curPos::Int # index in the procs, states and handles array of current session curPos::Int # index in the procs, states and handles array of current session
MainState() = new(:cyan, :yellow, 2, MainState() = new(:cyan, :yellow, 0,
"", "", Vector{GnuplotProc}(), Vector{GnuplotSession}(), "", "", Vector{GnuplotProc}(), Vector{GnuplotSession}(),
Vector{Int}(), 0) Vector{Int}(), 0)
end end