Skip to content

Commit 654dcd9

Browse files
committed
test: simple plot recipe tests with indices
1 parent 3e0aa6d commit 654dcd9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/plot_sim.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ end
712712
Plot the simulation results of a [`PredictiveController`](@ref).
713713
714714
# Arguments
715+
!!! info
715716
The keyword arguments can be `Bool`s, index ranges e.g. `2:4` or vectors e.g. `[1, 3]`,
716717
to select the variables to plot.
717718

test/test_plot_sim.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ end
3535
@test p[7][1][:y] res.X_data[2, :]
3636
@test p[8][1][:y] res.X_data[3, :]
3737
@test p[9][1][:y] res.X_data[4, :]
38+
p = plot(res, ploty=[2])
39+
@test p[1][1][:x] res.T_data
40+
@test p[1][1][:y] res.Y_data[2, :]
41+
p = plot(res, ploty=false, plotu=false, plotd=false, plotx=2:4)
42+
@test p[1][1][:x] res.T_data
43+
@test p[1][1][:y] res.X_data[2, :]
44+
@test p[2][1][:y] res.X_data[3, :]
45+
@test p[3][1][:y] res.X_data[4, :]
3846
end
3947

4048
@testset "StateEstimator quick simulation" begin

0 commit comments

Comments
 (0)