ƒ

Scatter Plot

Sinks
Run the live example Free · no sign-up · runs in your browser

The ScatterPlot block displays the empirical joint distribution of two continuous or discrete signals as a two-dimensional point cloud on the canvas. At each simulation step, the simultaneous instantaneous values of the XX and YY inputs are plotted as a distinct point marker. Over the course of a simulation run, this builds up an aggregated scatter diagram, making it an indispensable tool for identifying cross-correlations, inspecting sensor noise covariance, visualizing Poincaré return maps, and studying Lissajous frequency ratios.

Mathematical Model

The block records pairs of input samples at discrete simulation time steps tk∈{t0,t1,…,tN}t_k \in \{t_0, t_1, \dots, t_N\}:

P={(x(tk),y(tk))  |  k=0,1,…,N}⊂R2\mathcal{P} = \left\{ \left(x(t_k), y(t_k)\right) \;\middle|\; k = 0, 1, \dots, N \right\} \subset \mathbb{R}^2

The empirical bivariate sample covariance between signals xx and yy across N+1N+1 points is:

Cov⁡(x,y)=1N∑k=0N(x(tk)−xˉ)(y(tk)−yˉ)\operatorname{Cov}(x, y) = \frac{1}{N} \sum_{k=0}^N \left( x(t_k) - \bar{x} \right) \left( y(t_k) - \bar{y} \right)

with Pearson correlation coefficient:

ρx,y=Cov⁡(x,y)σxσy∈[−1,1]\rho_{x,y} = \frac{\operatorname{Cov}(x, y)}{\sigma_x \sigma_y} \in [-1, 1]

Points are plotted on the canvas at screen coordinates transformed from data coordinates (xk,yk)(x_k, y_k), with each dot rendered with a radius proportional to pointSize and colored by color.

Inputs & Outputs

Direction ID Label Type Status
→ In x X number Required
→ In y Y number Required

Parameters

Parameters Label Type Default Description
title Title text Scatter Plot
pointSize Point Size number 4
color Color string #2563eb
showGrid Show Grid boolean true

Usage Examples

Example 1: Lissajous Curve Generation and Frequency Ratio Analysis

Verifying frequency and phase alignment between two harmonic oscillators. Driving input XX with a 1.0 Hz1.0\text{ Hz} sinusoid (sin⁡(2πt)\sin(2\pi t)) and input YY with a 3.0 Hz3.0\text{ Hz} sinusoid (sin⁡(6πt)\sin(6\pi t)). The resulting point cloud traces a stationary 1:3 Lissajous figure, providing visual confirmation of harmonic ratio without time-domain oscilloscope triggering.

Example 2: Dual-Sensor Noise Correlation and Covariance Analysis

Assessing whether sensor measurement noise on channel 1 is statistically independent of noise on channel 2. Routing two noisy sensor signals to ports XX and YY with pointSize = 2 and color = "#10b981". A circular, symmetric Gaussian point cloud confirms uncorrelated independent white noise (ρ≈0\rho \approx 0), whereas an elongated tilted ellipse reveals cross-coupling covariance.

Remarks & Best Practices

  • Point-Cloud Accumulation: Unlike XYPlot (which maintains a sliding FIFO trail of recent points), ScatterPlot accumulates all sample pairs for the entire simulation run, preserving the full statistical dataset.
  • Terminal Sink Node: ScatterPlot has no output ports and does not feed downstream simulation blocks; it operates purely as a visual analytical sink.
  • Independent Coordinate Axes: The horizontal axis strictly represents signal x(t)x(t), while the vertical axis represents y(t)y(t); simulation time tt is not plotted directly on either axis.
  • Clearing on Simulation Restart: The accumulated point buffer clears automatically whenever a simulation run is restarted, ensuring a clean canvas for subsequent runs.

Related Components

  • XYPlot: Phase-plane display with configurable fading trail length for dynamic trajectory visualization.
  • uPlotDisplay: Multi-channel time-series oscilloscope.
  • RandomNumber: Stochastic noise source for covariance testing.
  • NumericDisplay: Real-time LCD digital scalar readout.