diff --git a/Project.toml b/Project.toml index 6fcf56b..d2f1f5a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ControlPlots" uuid = "23c2ee80-7a9e-4350-b264-8e670f12517c" authors = ["Uwe Fechner and contributors"] -version = "0.0.4" +version = "0.0.5" [deps] JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" diff --git a/README.md b/README.md index 05c0f84..236304a 100644 --- a/README.md +++ b/README.md @@ -106,5 +106,5 @@ using ControlPlots x = 1.5*ones(11) y = 1:0.1:2 out = min.(x, y) -plotn(1:11, [x, y, out]; labels=["input_a", "input_b", "output"], fig="2-in-one") +plot(1:11, [x, y, out]; labels=["input_a", "input_b", "output"], fig="2-in-one") ``` diff --git a/src/ControlPlots.jl b/src/ControlPlots.jl index ecb3587..df8e991 100644 --- a/src/ControlPlots.jl +++ b/src/ControlPlots.jl @@ -5,7 +5,7 @@ import PyPlot.show as plshow import Base.display import JLD2 -export plot, plotn, plotx, plotxy, plt, load, save +export plot, plotx, plotxy, plt, load, save mutable struct PlotX X @@ -25,7 +25,7 @@ function load(filename::String) JLD2.load(filename)["plot"] end -function plotn(X, Ys; xlabel="", ylabel="", +function plot(X, Ys::AbstractVector{<:AbstractVector}; xlabel="", ylabel="", labels=nothing, fig="", disp=false) if disp if fig != "" @@ -57,7 +57,7 @@ function plotn(X, Ys; xlabel="", ylabel="", PlotX(X, Ys, labels, xlabel, ylabel, fig, 4) end -function plot(X, Y; xlabel="", ylabel="", fig="", disp=false) +function plot(X, Y::AbstractVector{<:Number}; xlabel="", ylabel="", fig="", disp=false) if disp if fig != "" plt.figure(fig) @@ -132,7 +132,7 @@ function display(P::PlotX) elseif P.type == 3 plotxy(P.X, P.Y; xlabel=P.xlabel, ylabel=P.ylabels, fig=P.fig, disp=true) else - plotn(P.X, P.Y; xlabel=P.xlabel, labels=P.labels, fig=P.fig, disp=true) + plot(P.X, P.Y; xlabel=P.xlabel, labels=P.labels, fig=P.fig, disp=true) end plt.pause(0.01) plt.show(block=false)