Skip to content

Commit

Permalink
replace plotn with plot
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Apr 4, 2024
1 parent dba48d0 commit 3753bab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ControlPlots"
uuid = "23c2ee80-7a9e-4350-b264-8e670f12517c"
authors = ["Uwe Fechner <[email protected]> and contributors"]
version = "0.0.4"
version = "0.0.5"

[deps]
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
```
8 changes: 4 additions & 4 deletions src/ControlPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 != ""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3753bab

Please sign in to comment.