Skip to content

Commit ac85187

Browse files
committed
use same color for flowpipe recipes
1 parent 4e628ca commit ac85187

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

src/Flowpipes/recipes.jl

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ using LazySets: plot_recipe,
2121
isapproxzero,
2222
_plot_singleton_list
2323

24+
DEFAULT_COLOR_FLOWPIPE = :blue
25+
2426
# heuristics for projecting a reach-set either concretely or lazily to the space
2527
# spanned by vars; the returned set is concrete when the exact projection can be done
2628
# efficiently; in all other cases a lazy set is returned
@@ -159,9 +161,9 @@ end
159161
aspect_ratio --> DEFAULT_ASPECT_RATIO
160162
end
161163
seriesalpha --> DEFAULT_ALPHA
162-
seriescolor --> DEFAULT_COLOR
164+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
163165

164-
if !(0 vars) && (setrep(list) <: AbstractSingleton)
166+
@series if !(0 vars) && (setrep(list) <: AbstractSingleton)
165167
seriestype --> :scatter
166168
_plot_singleton_list(list)
167169
else
@@ -181,14 +183,16 @@ end
181183
aspect_ratio --> DEFAULT_ASPECT_RATIO
182184
end
183185
seriesalpha --> DEFAULT_ALPHA
184-
seriescolor --> DEFAULT_COLOR
186+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
185187
seriestype --> :shape
186188

187-
Xs = LazySet{N}[]
188-
for F in fp
189-
append!(Xs, _plot_reachset_list(F, vars))
189+
@series begin
190+
Xs = LazySet{N}[]
191+
for F in fp
192+
append!(Xs, _plot_reachset_list(F, vars))
193+
end
194+
Xs
190195
end
191-
return Xs
192196
end
193197

194198
# ========================
@@ -205,10 +209,10 @@ end
205209
aspect_ratio --> DEFAULT_ASPECT_RATIO
206210
end
207211
seriesalpha --> DEFAULT_ALPHA
208-
seriescolor --> DEFAULT_COLOR
212+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
209213

210214
fp = flowpipe(sol)
211-
if !(0 vars) && (setrep(fp) <: AbstractSingleton)
215+
@series if !(0 vars) && (setrep(fp) <: AbstractSingleton)
212216
seriestype --> :scatter
213217
_plot_singleton_list(fp)
214218
else
@@ -229,15 +233,17 @@ end
229233
aspect_ratio --> DEFAULT_ASPECT_RATIO
230234
end
231235
seriesalpha --> DEFAULT_ALPHA
232-
seriescolor --> DEFAULT_COLOR
236+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
233237
seriestype --> :shape
234238

235-
fp = flowpipe(sol)
236-
Xs = LazySet{N}[]
237-
for F in fp
238-
append!(Xs, _plot_reachset_list(F, vars))
239+
@series begin
240+
fp = flowpipe(sol)
241+
Xs = LazySet{N}[]
242+
for F in fp
243+
append!(Xs, _plot_reachset_list(F, vars))
244+
end
245+
Xs
239246
end
240-
return Xs
241247
end
242248

243249
# TODO new plot recipe to dispatch on ShiftedFlowpipe
@@ -257,7 +263,7 @@ end
257263
aspect_ratio --> DEFAULT_ASPECT_RATIO
258264
end
259265
seriesalpha --> DEFAULT_ALPHA
260-
seriescolor --> DEFAULT_COLOR
266+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
261267
seriestype --> :shape
262268

263269
first = true
@@ -328,7 +334,7 @@ end
328334
aspect_ratio --> DEFAULT_ASPECT_RATIO
329335
end
330336
seriesalpha --> DEFAULT_ALPHA
331-
seriescolor --> DEFAULT_COLOR
337+
seriescolor --> DEFAULT_COLOR_FLOWPIPE
332338
seriestype --> :scatter
333339
markershape --> :circle
334340

0 commit comments

Comments
 (0)