XYPlot
SinksThe XYPlot block plots two real-time scalar signals against each other in a phase-plane view, retaining a configurable number of the most recent sample pairs as a fading trail. The display updates live at each simulation step, making it well suited to observing limit cycles, phase portraits, and dynamic trajectories as they evolve.
Unlike the ScatterPlot block, XYPlot is designed for animated real-time monitoring: only the most recent trailLength samples are visible, so the plot always emphasises current behaviour rather than accumulating the full run history.
Mathematical Model
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | x |
X | number | Required |
| → In | y |
Y | number | Required |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
autoScale |
Auto Scale Axes | boolean | true |
|
xMin |
X Min | number | -1 |
|
xMax |
X Max | number | 1 |
|
yMin |
Y Min | number | -1 |
|
yMax |
Y Max | number | 1 |
|
showGrid |
Show Grid | boolean | true |
|
pointColor |
Point Color | string | #f97316 |
|
trailLength |
Max Points (0 = keep all) | number | 0 |
Usage Examples
Van der Pol phase portrait
VanDerPol.x → XYPlot.X
VanDerPol.xdot → XYPlot.Y
Display the state-space trajectory of a Van der Pol oscillator. The limit cycle becomes visible after a few oscillation periods.
PID error vs. control effort
ErrorSignal → XYPlot.X
ControlOutput → XYPlot.Y
Plot error against controller output to inspect saturation behaviour and the shape of the control law in real time.
Remarks & Best Practices
- Sink block: XYPlot has no output ports. It is a terminal display node and does not feed any downstream computation.
- Two scalar inputs: The X and Y ports each accept a single scalar numeric signal. Vector signals must be demuxed before connecting.
- Sliding window: Only the last
trailLengthsamples are shown. Increase this value to see longer trajectory history; decrease it for a tighter focus on current dynamics. - No time axis: The horizontal axis represents the X signal value, not simulation time.
Related Components
- ScatterPlot: Accumulates all sample pairs for the full run; preferred when the complete point cloud matters more than recent trajectory.
- uPlotDisplay: Time-series scope for plotting signals against simulation time.
- Histogram: Displays the statistical distribution of a single scalar signal.