plotting
Plotting helpers for hybrid system traces.
plot_trace(trace, dims=None, *, location_colors=None, show_locations=True, show_location_labels=False, show_events=True, show_event_labels=True, show=False, ax=None)
Plot state trajectories with location shading and event markers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace
|
Trace
|
Trace to visualize. |
required |
dims
|
Sequence[int] | None
|
State indices to plot. |
None
|
location_colors
|
Mapping[str, str] | None
|
Optional color mapping for locations. |
None
|
show_locations
|
bool
|
Whether to shade location regions. |
True
|
show_location_labels
|
bool
|
Whether to label locations above the trace. |
False
|
show_events
|
bool
|
Whether to show transition events. |
True
|
show_event_labels
|
bool
|
Whether to label transition events. |
True
|
show
|
bool
|
Whether to call matplotlib show(). |
False
|
ax
|
Axes | None
|
Optional axis to draw into. |
None
|
Returns:
| Type | Description |
|---|---|
Axes
|
Matplotlib axes containing the plot. |
Source code in src/flowcean/ode/plotting.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
plot_phase(trace, x_dim=0, y_dim=1, *, location_colors=None, show_location_legend=True, show=False, ax=None)
Plot phase portrait segments colored by location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace
|
Trace
|
Trace to visualize. |
required |
x_dim
|
int
|
State index on the x-axis. |
0
|
y_dim
|
int
|
State index on the y-axis. |
1
|
location_colors
|
Mapping[str, str] | None
|
Optional color mapping for locations. |
None
|
show_location_legend
|
bool
|
Whether to show location labels in legend. |
True
|
show
|
bool
|
Whether to call matplotlib show(). |
False
|
ax
|
Axes | None
|
Optional axis to draw into. |
None
|
Returns:
| Type | Description |
|---|---|
Axes
|
Matplotlib axes containing the plot. |
Source code in src/flowcean/ode/plotting.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |