@@ -79,143 +79,143 @@ function test_plot()
7979 #
8080 @test display (sol) isa Nothing
8181
82- # # --------------------------------------------------------
83- # # --------------------------------------------------------
84- # # other example with path constraints
85- # ocp, sol = solution_example_path_constraints()
86-
87- # #
88- # @test plot(sol; time=:default) isa Plots.Plot
89- # @test plot(sol; time=:normalize) isa Plots.Plot
90- # @test plot(sol; time=:normalise) isa Plots.Plot
91- # @test_throws CTBase.IncorrectArgument plot(sol; time=:wrong_choice)
92-
93- # @test plot(sol, ocp; time=:default) isa Plots.Plot
94- # @test plot(sol, ocp; time=:normalize) isa Plots.Plot
95- # @test plot(sol, ocp; time=:normalise) isa Plots.Plot
96- # @test_throws CTBase.IncorrectArgument plot(sol, ocp; time=:wrong_choice)
97-
98- # #
99- # @test plot(sol; layout=:group, control=:components) isa Plots.Plot
100- # @test plot(sol; layout=:group, control=:norm) isa Plots.Plot
101- # @test plot(sol; layout=:group, control=:all) isa Plots.Plot
102- # @test_throws CTBase.IncorrectArgument plot(sol; layout=:group, control=:wrong_choice)
103-
104- # @test plot(sol, ocp; layout=:group, control=:components) isa Plots.Plot
105- # @test plot(sol, ocp; layout=:group, control=:norm) isa Plots.Plot
106- # @test plot(sol, ocp; layout=:group, control=:all) isa Plots.Plot
107- # @test_throws CTBase.IncorrectArgument plot(sol, ocp; layout=:group, control=:wrong_choice)
108-
109- # #
110- # @test plot(sol; layout=:split, control=:components) isa Plots.Plot
111- # @test plot(sol; layout=:split, control=:norm) isa Plots.Plot
112- # @test plot(sol; layout=:split, control=:all) isa Plots.Plot
113- # @test_throws CTBase.IncorrectArgument plot(sol; layout=:split, control=:wrong_choice)
114-
115- # @test plot(sol, ocp; layout=:split, control=:components) isa Plots.Plot
116- # @test plot(sol, ocp; layout=:split, control=:norm) isa Plots.Plot
117- # @test plot(sol, ocp; layout=:split, control=:all) isa Plots.Plot
118- # @test_throws CTBase.IncorrectArgument plot(sol, ocp; layout=:split, control=:wrong_choice)
119-
120- # #
121- # @test plot(sol; layout=:split) isa Plots.Plot
122- # @test plot(sol; layout=:group) isa Plots.Plot
123- # @test_throws CTBase.IncorrectArgument plot(sol; layout=:wrong_choice)
124-
125- # @test plot(sol, ocp; layout=:split) isa Plots.Plot
126- # @test plot(sol, ocp; layout=:group) isa Plots.Plot
127- # @test_throws CTBase.IncorrectArgument plot(sol, ocp; layout=:wrong_choice)
128-
129- # #
130- # plt = plot(sol; time=:default)
131- # @test plot!(plt, sol; time=:default) isa Plots.Plot
132- # @test plot!(plt, sol; time=:normalize) isa Plots.Plot
133- # @test plot!(plt, sol; time=:normalise) isa Plots.Plot
134- # @test_throws CTBase.IncorrectArgument plot!(plt, sol; time=:wrong_choice)
135-
136- # plt = plot(sol, ocp; time=:default)
137- # @test plot!(plt, sol, ocp; time=:default) isa Plots.Plot
138- # @test plot!(plt, sol, ocp; time=:normalize) isa Plots.Plot
139- # @test plot!(plt, sol, ocp; time=:normalise) isa Plots.Plot
140- # @test_throws CTBase.IncorrectArgument plot!(plt, sol, ocp; time=:wrong_choice)
141-
142- # #
143- # plt = plot(sol; layout=:group, control=:components)
144- # @test plot!(plt, sol; layout=:group, control=:components) isa Plots.Plot
145- # @test plot!(plt, sol; layout=:group, control=:norm) isa Plots.Plot
146-
147- # plt = plot(sol; layout=:group, control=:norm)
148- # @test plot!(plt, sol; layout=:group, control=:components) isa Plots.Plot
149- # @test plot!(plt, sol; layout=:group, control=:norm) isa Plots.Plot
150-
151- # plt = plot(sol; layout=:group, control=:all)
152- # @test plot!(plt, sol; layout=:group, control=:all) isa Plots.Plot
153-
154- # @test_throws CTBase.IncorrectArgument plot!(
155- # plt, sol; layout=:group, control=:wrong_choice
156- # )
157-
158- # plt = plot(sol, ocp; layout=:group, control=:components)
159- # @test plot!(plt, sol, ocp; layout=:group, control=:components) isa Plots.Plot
160- # @test plot!(plt, sol, ocp; layout=:group, control=:norm) isa Plots.Plot
161-
162- # plt = plot(sol, ocp; layout=:group, control=:norm)
163- # @test plot!(plt, sol, ocp; layout=:group, control=:components) isa Plots.Plot
164- # @test plot!(plt, sol, ocp; layout=:group, control=:norm) isa Plots.Plot
165-
166- # plt = plot(sol, ocp; layout=:group, control=:all)
167- # @test plot!(plt, sol, ocp; layout=:group, control=:all) isa Plots.Plot
168-
169- # @test_throws CTBase.IncorrectArgument plot!(
170- # plt, sol, ocp; layout=:group, control=:wrong_choice
171- # )
172-
173- # #
174- # plt = plot(sol, ocp; layout=:split, control=:components)
175- # @test plot!(plt, sol, ocp; layout=:split, control=:components) isa Plots.Plot
176- # @test plot!(plt, sol, ocp; layout=:split, control=:norm) isa Plots.Plot
177-
178- # plt = plot(sol, ocp; layout=:split, control=:norm)
179- # @test plot!(plt, sol, ocp; layout=:split, control=:components) isa Plots.Plot
180- # @test plot!(plt, sol, ocp; layout=:split, control=:norm) isa Plots.Plot
181-
182- # plt = plot(sol, ocp; layout=:split, control=:all)
183- # @test plot!(plt, sol, ocp; layout=:split, control=:all) isa Plots.Plot
184-
185- # @test_throws CTBase.IncorrectArgument plot!(
186- # plt, sol, ocp; layout=:split, control=:wrong_choice
187- # )
188-
189- # plt = plot(sol, ocp; layout=:split, control=:components)
190- # @test plot!(plt, sol, ocp; layout=:split, control=:components) isa Plots.Plot
191- # @test plot!(plt, sol, ocp; layout=:split, control=:norm) isa Plots.Plot
192-
193- # plt = plot(sol, ocp; layout=:split, control=:norm)
194- # @test plot!(plt, sol, ocp; layout=:split, control=:components) isa Plots.Plot
195- # @test plot!(plt, sol, ocp; layout=:split, control=:norm) isa Plots.Plot
196-
197- # plt = plot(sol, ocp; layout=:split, control=:all)
198- # @test plot!(plt, sol, ocp; layout=:split, control=:all) isa Plots.Plot
199-
200- # @test_throws CTBase.IncorrectArgument plot!(
201- # plt, sol, ocp; layout=:split, control=:wrong_choice
202- # )
82+ # --------------------------------------------------------
83+ # --------------------------------------------------------
84+ # other example with path constraints
85+ ocp, sol = solution_example_path_constraints ()
20386
204- # #
205- # plt = plot(sol; layout=:split)
206- # @test plot!(plt, sol; layout=:split) isa Plots.Plot
87+ #
88+ @test plot (sol; time= :default ) isa Plots. Plot
89+ @test plot (sol; time= :normalize ) isa Plots. Plot
90+ @test plot (sol; time= :normalise ) isa Plots. Plot
91+ @test_throws CTBase. IncorrectArgument plot (sol; time= :wrong_choice )
92+
93+ @test plot (sol, ocp; time= :default ) isa Plots. Plot
94+ @test plot (sol, ocp; time= :normalize ) isa Plots. Plot
95+ @test plot (sol, ocp; time= :normalise ) isa Plots. Plot
96+ @test_throws CTBase. IncorrectArgument plot (sol, ocp; time= :wrong_choice )
97+
98+ #
99+ @test plot (sol; layout= :group , control= :components ) isa Plots. Plot
100+ @test plot (sol; layout= :group , control= :norm ) isa Plots. Plot
101+ @test plot (sol; layout= :group , control= :all ) isa Plots. Plot
102+ @test_throws CTBase. IncorrectArgument plot (sol; layout= :group , control= :wrong_choice )
103+
104+ @test plot (sol, ocp; layout= :group , control= :components ) isa Plots. Plot
105+ @test plot (sol, ocp; layout= :group , control= :norm ) isa Plots. Plot
106+ @test plot (sol, ocp; layout= :group , control= :all ) isa Plots. Plot
107+ @test_throws CTBase. IncorrectArgument plot (sol, ocp; layout= :group , control= :wrong_choice )
108+
109+ #
110+ @test plot (sol; layout= :split , control= :components ) isa Plots. Plot
111+ @test plot (sol; layout= :split , control= :norm ) isa Plots. Plot
112+ @test plot (sol; layout= :split , control= :all ) isa Plots. Plot
113+ @test_throws CTBase. IncorrectArgument plot (sol; layout= :split , control= :wrong_choice )
114+
115+ @test plot (sol, ocp; layout= :split , control= :components ) isa Plots. Plot
116+ @test plot (sol, ocp; layout= :split , control= :norm ) isa Plots. Plot
117+ @test plot (sol, ocp; layout= :split , control= :all ) isa Plots. Plot
118+ @test_throws CTBase. IncorrectArgument plot (sol, ocp; layout= :split , control= :wrong_choice )
119+
120+ #
121+ @test plot (sol; layout= :split ) isa Plots. Plot
122+ @test plot (sol; layout= :group ) isa Plots. Plot
123+ @test_throws CTBase. IncorrectArgument plot (sol; layout= :wrong_choice )
124+
125+ @test plot (sol, ocp; layout= :split ) isa Plots. Plot
126+ @test plot (sol, ocp; layout= :group ) isa Plots. Plot
127+ @test_throws CTBase. IncorrectArgument plot (sol, ocp; layout= :wrong_choice )
128+
129+ #
130+ plt = plot (sol; time= :default )
131+ @test plot! (plt, sol; time= :default ) isa Plots. Plot
132+ @test plot! (plt, sol; time= :normalize ) isa Plots. Plot
133+ @test plot! (plt, sol; time= :normalise ) isa Plots. Plot
134+ @test_throws CTBase. IncorrectArgument plot! (plt, sol; time= :wrong_choice )
135+
136+ plt = plot (sol, ocp; time= :default )
137+ @test plot! (plt, sol, ocp; time= :default ) isa Plots. Plot
138+ @test plot! (plt, sol, ocp; time= :normalize ) isa Plots. Plot
139+ @test plot! (plt, sol, ocp; time= :normalise ) isa Plots. Plot
140+ @test_throws CTBase. IncorrectArgument plot! (plt, sol, ocp; time= :wrong_choice )
141+
142+ #
143+ plt = plot (sol; layout= :group , control= :components )
144+ @test plot! (plt, sol; layout= :group , control= :components ) isa Plots. Plot
145+ @test plot! (plt, sol; layout= :group , control= :norm ) isa Plots. Plot
146+
147+ plt = plot (sol; layout= :group , control= :norm )
148+ @test plot! (plt, sol; layout= :group , control= :components ) isa Plots. Plot
149+ @test plot! (plt, sol; layout= :group , control= :norm ) isa Plots. Plot
150+
151+ plt = plot (sol; layout= :group , control= :all )
152+ @test plot! (plt, sol; layout= :group , control= :all ) isa Plots. Plot
153+
154+ @test_throws CTBase. IncorrectArgument plot! (
155+ plt, sol; layout= :group , control= :wrong_choice
156+ )
157+
158+ plt = plot (sol, ocp; layout= :group , control= :components )
159+ @test plot! (plt, sol, ocp; layout= :group , control= :components ) isa Plots. Plot
160+ @test plot! (plt, sol, ocp; layout= :group , control= :norm ) isa Plots. Plot
161+
162+ plt = plot (sol, ocp; layout= :group , control= :norm )
163+ @test plot! (plt, sol, ocp; layout= :group , control= :components ) isa Plots. Plot
164+ @test plot! (plt, sol, ocp; layout= :group , control= :norm ) isa Plots. Plot
165+
166+ plt = plot (sol, ocp; layout= :group , control= :all )
167+ @test plot! (plt, sol, ocp; layout= :group , control= :all ) isa Plots. Plot
168+
169+ @test_throws CTBase. IncorrectArgument plot! (
170+ plt, sol, ocp; layout= :group , control= :wrong_choice
171+ )
172+
173+ #
174+ plt = plot (sol, ocp; layout= :split , control= :components )
175+ @test plot! (plt, sol, ocp; layout= :split , control= :components ) isa Plots. Plot
176+ @test plot! (plt, sol, ocp; layout= :split , control= :norm ) isa Plots. Plot
177+
178+ plt = plot (sol, ocp; layout= :split , control= :norm )
179+ @test plot! (plt, sol, ocp; layout= :split , control= :components ) isa Plots. Plot
180+ @test plot! (plt, sol, ocp; layout= :split , control= :norm ) isa Plots. Plot
181+
182+ plt = plot (sol, ocp; layout= :split , control= :all )
183+ @test plot! (plt, sol, ocp; layout= :split , control= :all ) isa Plots. Plot
184+
185+ @test_throws CTBase. IncorrectArgument plot! (
186+ plt, sol, ocp; layout= :split , control= :wrong_choice
187+ )
188+
189+ plt = plot (sol, ocp; layout= :split , control= :components )
190+ @test plot! (plt, sol, ocp; layout= :split , control= :components ) isa Plots. Plot
191+ @test plot! (plt, sol, ocp; layout= :split , control= :norm ) isa Plots. Plot
192+
193+ plt = plot (sol, ocp; layout= :split , control= :norm )
194+ @test plot! (plt, sol, ocp; layout= :split , control= :components ) isa Plots. Plot
195+ @test plot! (plt, sol, ocp; layout= :split , control= :norm ) isa Plots. Plot
207196
208- # plt = plot(sol; layout=:group )
209- # @test plot!(plt, sol; layout=:group ) isa Plots.Plot
197+ plt = plot (sol, ocp ; layout= :split , control = :all )
198+ @test plot! (plt, sol, ocp ; layout= :split , control = :all ) isa Plots. Plot
210199
211- # @test_throws CTBase.IncorrectArgument plot!(plt, sol; layout=:wrong_choice)
200+ @test_throws CTBase. IncorrectArgument plot! (
201+ plt, sol, ocp; layout= :split , control= :wrong_choice
202+ )
203+
204+ #
205+ plt = plot (sol; layout= :split )
206+ @test plot! (plt, sol; layout= :split ) isa Plots. Plot
207+
208+ plt = plot (sol; layout= :group )
209+ @test plot! (plt, sol; layout= :group ) isa Plots. Plot
210+
211+ @test_throws CTBase. IncorrectArgument plot! (plt, sol; layout= :wrong_choice )
212212
213- # plt = plot(sol, ocp; layout=:split)
214- # @test plot!(plt, sol, ocp; layout=:split) isa Plots.Plot
213+ plt = plot (sol, ocp; layout= :split )
214+ @test plot! (plt, sol, ocp; layout= :split ) isa Plots. Plot
215215
216- # plt = plot(sol, ocp; layout=:group)
217- # @test plot!(plt, sol, ocp; layout=:group) isa Plots.Plot
216+ plt = plot (sol, ocp; layout= :group )
217+ @test plot! (plt, sol, ocp; layout= :group ) isa Plots. Plot
218218
219- # @test_throws CTBase.IncorrectArgument plot!(plt, sol, ocp; layout=:wrong_choice)
219+ @test_throws CTBase. IncorrectArgument plot! (plt, sol, ocp; layout= :wrong_choice )
220220
221221end
0 commit comments