@@ -318,11 +318,13 @@ end
318318" Keep manipulated input `u` unchanged for state estimator simulation."
319319sim_getu! (:: StateEstimator , u, _ , _ ) = u
320320
321-
322- # dummy plot methods to document recipes (both in ?-mode and web documentation)
323- plot (:: Nothing , :: SimResult{<:Real, <:SimModel} ) = nothing
324- plot (:: Nothing , :: SimResult{<:Real, <:StateEstimator} ) = nothing
325- plot (:: Nothing , :: SimResult{<:Real, <:PredictiveController} ) = nothing
321+ function get_indices (arg:: IntRangeOrVector , n)
322+ if length (unique (arg)) ≠ length (arg) || maximum (arg) > n
323+ error (" Plot keyword argument arguments should contains valid and unique indices" )
324+ end
325+ return arg
326+ end
327+ get_indices (arg:: Bool , n) = arg ? (1 : n) : Int64[]
326328
327329@doc raw """
328330 plot(res::SimResult{<:Real, <:SimModel}; <keyword arguments>)
@@ -348,15 +350,7 @@ julia> using Plots; plot(res, plotu=false)
348350```
349351
350352"""
351- plot (:: Nothing , :: SimResult{<:Real, <:SimModel} )
352-
353- function get_indices (arg:: IntRangeOrVector , n)
354- if length (unique (arg)) ≠ length (arg) || maximum (arg) > n
355- error (" Plot keyword argument arguments should contains valid and unique indices" )
356- end
357- return arg
358- end
359- get_indices (arg:: Bool , n) = arg ? (1 : n) : Int64[]
353+ plot_recipe (:: Nothing , :: SimResult{<:Real, <:SimModel} ) = nothing
360354
361355@recipe function plot_recipe (
362356 res:: SimResult{<:Real, <:SimModel} ;
@@ -468,7 +462,7 @@ Plot the simulation results of a [`StateEstimator`](@ref).
468462 if applicable
469463- `plotx̂max=true` or *`plotxhatmax`* : plot estimated state upper bounds ``\m athbf{x̂_{max}}``
470464 if applicable
471- - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:SimModel})`](@ref)
465+ - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:SimModel})`](@ref plot_recipe )
472466
473467# Examples
474468```julia-repl
@@ -478,7 +472,7 @@ julia> using Plots; plot(res, plotu=false, plotŷ=true, plotxwithx̂=true)
478472```
479473
480474"""
481- plot (:: Nothing , :: SimResult{<:Real, <:StateEstimator} )
475+ plot_recipe (:: Nothing , :: SimResult{<:Real, <:StateEstimator} ) = nothing
482476
483477@recipe function plot_recipe (
484478 res:: SimResult{<:Real, <:StateEstimator} ;
@@ -726,8 +720,8 @@ Plot the simulation results of a [`PredictiveController`](@ref).
726720- `plotru=true` : plot manipulated input setpoints ``\m athbf{r_u}`` if applicable
727721- `plotumin=true` : plot manipulated input lower bounds ``\m athbf{u_{min}}`` if applicable
728722- `plotumax=true` : plot manipulated input upper bounds ``\m athbf{u_{max}}`` if applicable
729- - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:SimModel})`](@ref)
730- - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:StateEstimator})`](@ref)
723+ - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:SimModel})`](@ref plot_recipe )
724+ - `<keyword arguments>` of [`plot(::SimResult{<:Real, <:StateEstimator})`](@ref plot_recipe )
731725
732726# Examples
733727```julia-repl
@@ -739,7 +733,7 @@ julia> using Plots; plot(res, plotŷ=true, plotry=true, plotumax=true, plotx̂=
739733```
740734
741735"""
742- plot (:: Nothing , :: SimResult{<:Real, <:PredictiveController} )
736+ plot_recipe (:: Nothing , :: SimResult{<:Real, <:PredictiveController} ) = nothing
743737
744738@recipe function plot_recipe (
745739 res:: SimResult{<:Real, <:PredictiveController} ;
0 commit comments