From 981c303381c8fb71a9f557c11ee4796b5a4d7638 Mon Sep 17 00:00:00 2001 From: Huckleberry Febbo Date: Tue, 7 Jul 2020 12:55:59 -0700 Subject: [PATCH] added in a check to ensure that nonexistent data is not accessed for initial state prediction --- src/PrettyPlots/NLOptControl_plots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PrettyPlots/NLOptControl_plots.jl b/src/PrettyPlots/NLOptControl_plots.jl index 9ad87f5..972f9b9 100644 --- a/src/PrettyPlots/NLOptControl_plots.jl +++ b/src/PrettyPlots/NLOptControl_plots.jl @@ -132,7 +132,7 @@ function statePlot(n,idx::Int64,st::Int64,args...;kwargs...) plot!(time,vals,line=_pretty_defaults[:plant_lines][1],label=string(legend_string,"plant")); end - if _pretty_defaults[:X0p] + if _pretty_defaults[:X0p] && length(n.r.ip.X0p) > idx X0 = n.r.ip.X0p[idx][1] t = n.r.ip.X0p[idx][2] scatter!((t,X0[st]),marker=_pretty_defaults[:X0p_marker],label="X0p")