Skip to content

Commit

Permalink
added in a check to ensure that nonexistent data is not accessed for …
Browse files Browse the repository at this point in the history
…initial state prediction
  • Loading branch information
huckl3b3rry87 committed Jul 7, 2020
1 parent 20a5dbb commit 981c303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PrettyPlots/NLOptControl_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 981c303

Please sign in to comment.