|
1 | 1 | """ |
2 | 2 | $(TYPEDSIGNATURES) |
3 | 3 |
|
4 | | -Used to set the default value of the layout of the plots. |
5 | | -Either :split or :group. |
| 4 | +Default layout for the full plot. |
| 5 | +
|
| 6 | +Returns `:split`, which arranges each component (e.g. state, control) in separate subplots. |
| 7 | +
|
| 8 | +Possible values: |
| 9 | +- `:split`: One subplot per component (default). |
| 10 | +- `:group`: Combine components into shared subplots. |
| 11 | +
|
| 12 | +Used as the default for `layout` in `plot(sol; layout=...)`. |
6 | 13 | """ |
7 | 14 | __plot_layout() = :split |
8 | 15 |
|
9 | 16 | """ |
10 | 17 | $(TYPEDSIGNATURES) |
11 | 18 |
|
12 | | -Used to set the default value of the layout of the control plots. |
13 | | -Either :components or :norm or :all. |
| 19 | +Default layout for control input visualization. |
| 20 | +
|
| 21 | +Returns `:components`, which plots each control component individually. |
| 22 | +
|
| 23 | +Possible values: |
| 24 | +- `:components`: One plot per control component (default). |
| 25 | +- `:norm`: Single plot showing the control norm ‖u(t)‖. |
| 26 | +- `:all`: Show both components and norm. |
| 27 | +
|
| 28 | +Used as the default for `control` in `plot(sol; control=...)`. |
14 | 29 | """ |
15 | 30 | __control_layout() = :components |
16 | 31 |
|
17 | 32 | """ |
18 | 33 | $(TYPEDSIGNATURES) |
19 | 34 |
|
20 | | -Used to set the default value of the time grid normalization. |
21 | | -Either :default or :normalize or :normalise. |
| 35 | +Default time axis normalization. |
| 36 | +
|
| 37 | +Returns `:default`, which plots against real time. |
| 38 | +
|
| 39 | +Possible values: |
| 40 | +- `:default`: Plot time in original units (default). |
| 41 | +- `:normalize`: Normalize time to [0, 1]. |
| 42 | +- `:normalise`: Same as `:normalize`, British spelling. |
| 43 | +
|
| 44 | +Used as the default for `time` in `plot(sol; time=...)`. |
22 | 45 | """ |
23 | 46 | __time_normalization() = :default |
24 | 47 |
|
25 | 48 | """ |
26 | 49 | $(TYPEDSIGNATURES) |
27 | 50 |
|
| 51 | +Return the default list of description symbols to be plotted if the user does not specify any. |
| 52 | +
|
| 53 | +Includes aliases for backward compatibility. |
| 54 | +
|
| 55 | +Returns a tuple of symbols, such as: |
| 56 | +- `:state`, `:costate`, `:control`, `:path`, `:dual`, ... |
28 | 57 | """ |
29 | 58 | function __description() |
30 | 59 | ( |
|
46 | 75 | """ |
47 | 76 | $(TYPEDSIGNATURES) |
48 | 77 |
|
49 | | -Used to set the default value of the plot size. |
| 78 | +Compute a default size `(width, height)` for the plot figure. |
| 79 | +
|
| 80 | +This depends on the number of subplots, which is inferred from: |
| 81 | +- The layout (`:group` or `:split`) |
| 82 | +- The presence of state, control, costate, path constraint, or dual variable plots |
| 83 | +- The number of state and control variables |
| 84 | +- The control layout choice (`:components`, `:norm`, `:all`) |
| 85 | +
|
| 86 | +Used internally in the `plot` function to automatically size the output plot. |
| 87 | +
|
| 88 | +# Example |
| 89 | +```julia-repl |
| 90 | +julia> size = __size_plot(sol, model, :components, :split; ...) |
| 91 | +``` |
50 | 92 | """ |
51 | 93 | function __size_plot( |
52 | 94 | sol::CTModels.Solution, |
@@ -124,13 +166,21 @@ end |
124 | 166 | """ |
125 | 167 | $(TYPEDSIGNATURES) |
126 | 168 |
|
127 | | -Default style for the plot. Must be an empty tuple. |
| 169 | +Default plot style. |
| 170 | +
|
| 171 | +Returns an empty `NamedTuple()`, which means no style override is applied. |
| 172 | +
|
| 173 | +Used when no user-defined style is passed for plotting states, controls, etc. |
128 | 174 | """ |
129 | 175 | __plot_style() = NamedTuple() |
130 | 176 |
|
131 | 177 | """ |
132 | 178 | $(TYPEDSIGNATURES) |
133 | 179 |
|
134 | | -Default suffix label for the plot. Must be an empty string. |
| 180 | +Default suffix used for the solution label in plots. |
| 181 | +
|
| 182 | +Returns an empty string `""`. |
| 183 | +
|
| 184 | +This label can be used to distinguish multiple solutions in comparative plots. |
135 | 185 | """ |
136 | 186 | __plot_label_suffix() = "" |
0 commit comments