XY charts

An XY chart plots channels against another channel of the same length, sample by sample, such as a force against a displacement.

Two hysteresis loops
To try this page on the data of its screenshots, download demo-bench.tdms (group Hysteresis), demo-actuator-test.tdms (Load cycles, Pump vibration), demo-endurance.tdms (a million samples) and demo-iq.tdms (constellations) from the demo files.

Open an XY chart

  • Open XY chart in a group tab;

  • the button next to the chart button in the editor title bar of the viewer;

  • Measurement Data: Open XY Chart in the Command Palette.

The XY chart opens in a tab of its own, which VS Code restores after a restart.

Choose the X and the curves

  1. Choose the X of the chart at the top of the list of channels.

  2. Tick the channels to plot against it. Only channels of the length of the X can be ticked; the others are marked "≠", and their tooltip says why. The checkbox of a group ticks all its channels that can be plotted against the X, or unticks them all.

  3. To plot a channel against another X of its length, choose it in the menu of the channel: several pairs, of different lengths, fit in one chart. In the screenshot above, Force 2 is plotted against Displacement 2, Force 1 against the X of the chart, Displacement 1.

When nothing can be plotted against the X, the chart says why in place of the plots: no other channel has its length, so choose another X; or no two channels of the file have the same length, so plot them against time in a time chart.

When channels of several groups have the same name, such as a channel Voltage in each group of a test, the chart names them with their group, Test B / Voltage: on the X axis, in the toolbar and in the tooltips.

XY charts plot numeric channels only: timestamps, Booleans and text "cannot be plotted". Complex channels are plotted by part; see Constellations.

Constellations

A complex channel has the rows of its four parts in the list, as in time charts: real, imaginary, magnitude and phase (in radians). Each part can be the X of the chart, a curve, or the X of a curve, from its own menu.

Its constellation is its imaginary part against its real part: the symbols of an I/Q recording, or the circle that a resonance draws at the output of a lock-in amplifier (its Nyquist plot). Both parts have the unit of the channel, so they get equal scales: a circle stays a circle.

  • A new XY chart whose first channel is complex shows its constellation at once, drawn as points.

  • In another chart, Constellation: imaginary against real in the menu of a complex channel adds it. The row of the channel then says "constellation".

  • Ticking a complex channel plots its real and imaginary parts against the X of the chart; when that X is its real part, it plots its imaginary part, which is its constellation.

The cursor chart shows the magnitude of the channel: select the samples of a burst on it, and the XY chart draws the symbols of that burst only.

The constellation of a QPSK burst: its four symbols and the transitions between them

Millions of samples are drawn as a density image, as any other curve; see Curves of any size.

Lines or points

Lines

Lines join the samples in their order in the file.

Points

The samples are drawn alone, for clouds of points. They are translucent: where curves overlap, the one under shows through.

An XY chart drawn as points

One plot per unit of Y, one plot per Y channel, or all in one, as in time charts. The mouse over an entry of the legend, or over the row of a plotted channel, brings its curve to the front, as in time charts. Legends and plots of many curves are laid out as in time charts: a legend scrolls, or gives the number of its curves and the name of the curve under the mouse, and the plots scroll when they do not all fit.

Equal scales

XY charts give X and Y the same scale, as many pixels per unit, so that shapes and slopes are not distorted: a trajectory in mm, a circle that stays round. It applies to the plots whose X and Y have the same unit; the others fit each axis to its values. The view widens so that everything fits, and the mouse wheel zooms X and Y together.

The orbit of a pump shaft seen by two probes in µm

Equal scales are on by default, for every XY chart: setting measurementDataViewer.xyEqualScales. An icon in the toolbar, before Cursor, shows the scales that apply:

Icon Scales

Axes around a circle

Equal scales, in the plots whose X and Y have the same unit.

The same, faint

Equal scales are on, but no plot of the chart has X and Y of the same unit: each axis fits its values.

Axes around a flattened ellipse, faint

Equal scales are off: each axis fits its values, whatever their units.

Its tooltip says which case applies, and why. A click on it opens the setting in the settings of VS Code: once changed, every open XY chart follows it, and shows all its data again.

The XY chart zooms as a map:

Gesture Action

Mouse wheel

Zoom X and Y around the pointer. Over the Y axes or a legend, it scrolls the plots or the legend when they do not all fit.

Shift + wheel

Zoom X only.

Ctrl + wheel (a pinch)

Zoom Y only.

Drag

Pan.

Double click

Show everything.

The cursor chart

Under the plots, the cursor chart shows a channel of the length of the curves against its time: the X of the chart by default, any other one from its menu.

Point at a row

The mouse over the cursor chart points at a row. The XY chart marks the sample of each curve at that row, gives its Y in the legend and its X on the axis. The grid of values marks its cells and scrolls to them (Follow the charts); the mouse over a cell of the grid moves the cursor to its row. With ranges selected, the XY chart draws their samples only: its cursor follows the mouse over the ranges, and stays on the last row pointed at in a range elsewhere. The line above the cursor chart still gives the row under the mouse.

Show a part of the test

A zoom or a pan on the cursor chart, with the gestures of the time charts, makes the XY chart draw the samples of the visible range only.

Cursor in the toolbar hides it; the XY chart then draws all the samples.

Select ranges of samples

Select ranges of samples, such as some cycles of a test: the XY chart draws them, each apart, without a line from the end of a range to the start of the next. It draws a range while you select it, adjust it or move it, as the mouse moves: the cycles it holds show before you release the button.

With several ranges, each one is drawn in a colour of its own, the colour in which the cursor chart shades it: the cycles of each stage of a test, or a cycle at the start and at the end of an endurance test, are told apart at a glance. The colours are those of the ranges for every curve of the chart: the swatches of the legend turn grey, and the mouse over an entry of the legend still brings its curve to the front. Curves drawn as density images keep their colour.

Three ranges selected on the cursor chart
Gesture on the cursor chart Action

Drag, while it shows all the data

Select a range.

Shift + drag

Add another range, also when it is zoomed.

Shift + click on a range

Remove it.

Drag the edge of a range

Adjust it, at any zoom: the range takes the samples up to where the edge is released.

Drag inside a range

Move it, at any zoom, with its number of samples: to the next cycle of a test, for instance.

Click outside the ranges

Remove them all.

To set the edge of a range on a given sample, zoom in on the cursor chart, then drag the edge: the pointer turns into a double arrow over it. Over the inside of a range, it turns into a hand: drag the range where you want it; it stops at the first and at the last sample.

Clear ranges removes them too. The line above the cursor chart gives the number of ranges and of samples drawn. Choosing another channel for the cursor chart keeps the rows shown and the ranges selected.

Curves of any size

  • A curve whose drawing would keep more than 50,000 samples is drawn as a density image: its colour is stronger where the curve passes more often, such as the many cycles of an endurance test.

  • A pair of more than 4 million samples is drawn by the extension from the file, without being sent to the chart: 5 seconds for 100 million samples on a recent laptop.

  • Ranges of samples are read from the file only, also for these pairs.

A million samples of 1

Images

Image in the toolbar saves the XY chart as an SVG or PNG image, density images included, as for the time charts, with the setting measurementDataViewer.imageTheme. The images for a slide or a report keep the legend: a loop has no end where its name could go.

An XY chart in the dark theme of VS Code