Renamed CheckGnuplotVersion -> gpversion; Added key= keyword
This commit is contained in:
parent
9d1581dc2b
commit
c37d12aaa4
@ -63,14 +63,14 @@ const options = Options()
|
|||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
# CheckGnuplotVersion
|
# gpversion
|
||||||
|
|
||||||
Check whether gnuplot is runnable with the command given in `cmd`.
|
Check whether gnuplot is runnable with the default command.
|
||||||
Also check that gnuplot version is >= 4.7 (required to use data
|
Raise an error if version is < 4.7 (required to use data
|
||||||
blocks).
|
blocks).
|
||||||
"""
|
"""
|
||||||
function CheckGnuplotVersion(cmd::AbstractString)
|
function gpversion()
|
||||||
icmd = `$(cmd) --version`
|
icmd = `$(options.cmd) --version`
|
||||||
|
|
||||||
proc = open(`$icmd`, read=true)
|
proc = open(`$icmd`, read=true)
|
||||||
s = String(read(proc))
|
s = String(read(proc))
|
||||||
@ -101,6 +101,7 @@ function parseKeywords(; kwargs...)
|
|||||||
yrange=NTuple{2, Real},
|
yrange=NTuple{2, Real},
|
||||||
zrange=NTuple{2, Real},
|
zrange=NTuple{2, Real},
|
||||||
cbrange=NTuple{2, Real},
|
cbrange=NTuple{2, Real},
|
||||||
|
key=AbstractString,
|
||||||
title=AbstractString,
|
title=AbstractString,
|
||||||
xlabel=AbstractString,
|
xlabel=AbstractString,
|
||||||
ylabel=AbstractString,
|
ylabel=AbstractString,
|
||||||
@ -115,6 +116,7 @@ function parseKeywords(; kwargs...)
|
|||||||
ismissing(kw.yrange ) || (push!(out, "set yrange [" * join(kw.yrange , ":") * "]"))
|
ismissing(kw.yrange ) || (push!(out, "set yrange [" * join(kw.yrange , ":") * "]"))
|
||||||
ismissing(kw.zrange ) || (push!(out, "set zrange [" * join(kw.zrange , ":") * "]"))
|
ismissing(kw.zrange ) || (push!(out, "set zrange [" * join(kw.zrange , ":") * "]"))
|
||||||
ismissing(kw.cbrange) || (push!(out, "set cbrange [" * join(kw.cbrange, ":") * "]"))
|
ismissing(kw.cbrange) || (push!(out, "set cbrange [" * join(kw.cbrange, ":") * "]"))
|
||||||
|
ismissing(kw.key ) || (push!(out, "set key " * kw.key * ""))
|
||||||
ismissing(kw.title ) || (push!(out, "set title \"" * kw.title * "\""))
|
ismissing(kw.title ) || (push!(out, "set title \"" * kw.title * "\""))
|
||||||
ismissing(kw.xlabel ) || (push!(out, "set xlabel \"" * kw.xlabel * "\""))
|
ismissing(kw.xlabel ) || (push!(out, "set xlabel \"" * kw.xlabel * "\""))
|
||||||
ismissing(kw.ylabel ) || (push!(out, "set ylabel \"" * kw.ylabel * "\""))
|
ismissing(kw.ylabel ) || (push!(out, "set ylabel \"" * kw.ylabel * "\""))
|
||||||
@ -322,7 +324,7 @@ function GPSession(sid::Symbol)
|
|||||||
|
|
||||||
global options
|
global options
|
||||||
|
|
||||||
CheckGnuplotVersion(options.cmd)
|
gpversion()
|
||||||
session = DrySession(sid)
|
session = DrySession(sid)
|
||||||
|
|
||||||
pin = Base.Pipe()
|
pin = Base.Pipe()
|
||||||
@ -478,7 +480,7 @@ end
|
|||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
function newdataset(gp::DrySession, accum::Vector{String}; name="")
|
function newdataset(gp::DrySession, accum::Vector{String}; name="")
|
||||||
(name == "") && (name = string("\$data", length(gp.datas)))
|
(name == "") && (name = string("\$data", length(gp.datas)+1))
|
||||||
#name = "\$$name"
|
#name = "\$$name"
|
||||||
d = DataSet(name, accum)
|
d = DataSet(name, accum)
|
||||||
push!(gp.datas, d)
|
push!(gp.datas, d)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using Test, Gnuplot
|
using Test, Gnuplot
|
||||||
@info "Gnuplot version: " * string(Gnuplot.CheckGnuplotVersion(Gnuplot.options.cmd))
|
@info "Gnuplot version: " * string(Gnuplot.gpversion())
|
||||||
push!(Gnuplot.options.init, "set term unknown")
|
push!(Gnuplot.options.init, "set term unknown")
|
||||||
|
|
||||||
x = [1, 2, 3]
|
x = [1, 2, 3]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user