Scientific Plotting from Analysis

GX-TXT DEV112 P011-bis

Configure and publish 2D and 3D scientific plots from Analysis and check series, axes, legend and output.

Choose a Session and the plot type

In Configuration → Modules enable Scientific Dataset Plot. For the 2D exercise generate Sequential Join and Dataset Extract, run Sequential Table Join and use its joined Dataset. For 3D generate Analytical Calibrated Curve Family (50 × 5 × 300) and use calibrated.family.source. Open Dataset → Canonical table to read values, names and units. In the tab Analysis the module offers Scientific dataset 2D, Scientific dataset 2D – rectangle selection and Scientific dataset 3D. Select the checkboxes you want to run, or use Enable all and Disable all. Before starting, complete the required bindings for all active plots.

Selection of Analytical Calibrated Curve Family in Generate Session before the Session is created.
Selection of Analytical Calibrated Curve Family in Generate Session before the Session is created.

Configure… changes the properties of the figure for that row. Module graphics… opens the common graphics defaults. Enable Override global graphics for this module to act on width, height, DPI, fonts, line width, grid, and legend position and style. The 3D settings include azimuth, elevation, projection, aspect, manual X/Y/Z ratio and color bar. CLim min/max limit the values represented by the color scale. inherit global keeps the respective global preference. Series… opens the list of series. Variants… manages the saved representations of the plot. New from base creates a variant from the base plot. Duplicate copies the selected variant. Edit opens the editor with title, state Enabled, graphics options and bindings. Save stores, Save and render also starts rendering and Close closes the editor. Render regenerates the selected variant. Delete asks for confirmation and removes the variant and its artifacts. In the test Rettangolo didattico stays active after deleting the disabled copy. Check in Plots which variant each image belongs to.

Build, order and filter a 2D series

  1. Enable only Scientific dataset 2D. Open Series… on the first row. In Dataset choose table_joined.source, then X variable timestamp_s and Y variable value_V. Use ID unione and Label Campioni uniti. Press Add/update one series. The button updates the definition with the same ID and lets you add a second series with a different ID.
  2. Use Y axis left for the main measurement. right is useful if a second measurement has different units or scale. The right axis becomes meaningful with a series actually assigned to it. Check units and scale on the axes and in the legend.
  3. In Point order choose As stored / Sequential to keep the source order, By X ascending to sort by abscissa, or By variable… and the sorting column. The order changes how consecutive points are connected, for example in a hysteresis loop. Use Filter variable and the corresponding value to restrict the rows, and Refresh values to update levels and choices.
  4. For family traces set the Family variable, choose Selected value, Selected values or All values as separate series and give Family value(s) when required. You can also set a second parameter. Second behavior Filter restricts the values, Style category assigns a style per category, Split into series creates subdivisions. Second mode decides whether to use the single value, the selected list or all of them. Press Create family series to apply these roles and check the rows created. Add/update one series records the second parameter as metadata of the single series.
  5. In the list, Remove selected series deletes the selected definition. Up and Down change the presentation order, which matters for legend and overlaps. The order of the series and the selection of their points are part of the representation.

In the exercise CSV, choose famiglia as Family variable and tempo_s as the second parameter. After Refresh values, choose two values in each list, axis right and sorting By variable… on tensione_V. With Create family series, Filter created two series, one per family, after filtering on the two times. Style category and Split into series created four rows each for this input. Check in the column Axis the destination of the series. A marker circle with full can be selected for line_marker. Select the last series, move it with Up and Down, and use Remove selected series to delete it from the list.

Result of Create family series with two families and two values of the secondary parameter.
Result of Create family series with two families and two values of the secondary parameter.
2D series with timestamp on the abscissa and voltage on the ordinate.
2D series with timestamp on the abscissa and voltage on the ordinate.

Choose 2D representation, units and uncertainties

Representation
auto, line, scatter, line_marker
Preparation and reading
auto uses the figure settings. For voltage against time, line connects the samples in the set order, scatter shows the points and line_marker combines them. Check the time jump before interpreting the segment between two stretches.
Representation
step
Preparation and reading
For stepped values choose pre, post or mid in Step mode. The transition is, respectively, before the sample, after the sample or at the midpoint of the interval, depending on the position of the step in the plot.
Representation
errorbar
Preparation and reading
For a single absolute error, Y error mode symmetric and the corresponding amplitude column. asymmetric uses distinct columns Y error lower and Y error upper. The X options are analogous. Use non-negative values in the unit of the respective axis, contained in the same Dataset as the series. Set none to disable one of the two error axes.
Representation
band
Preparation and reading
Set Band lower and Band upper as absolute, ordered Y limits, on the same X grid. Draw center series with band adds the center curve. The band represents the limits of the assigned columns. Its statistical meaning depends on how they were built.
Representation
bar
Preparation and reading
Bind the values and their positions. If you have explicit intervals, use Bar X lower and Bar X upper from the same Dataset for the two edges.
Representation
histogram
Preparation and reading
Uses a column of measurements. Histogram normalization count shows the counts, probability normalizes the sum of the bars to one, density normalizes the area to one. Read the class limits and the unit before comparing histograms.
Representation
box_whisker
Preparation and reading
Uses a column of measurements with categories when several distributions are needed. Show box outliers 0/1 hides or shows the isolated points beyond the whiskers; the box concerns medians and quartiles.

In the series editor set color, line, marker, fill, width and size according to the representation. auto uses the figure assignment, inherit inherits the applicable preference. A marker none removes the symbol and the fill full colors the markers that support it. Controls not relevant to the representation may be disabled. In Configure… choose title, labels and displayed units, Trace style (auto, line, scatter, line_markers), Point order (auto, dataset_order, sort_x) and legend (auto, none, series). The Y axes can be automatic, linear or logarithmic. For log, check that the samples are strictly positive in the displayed unit. The labels auto come from the assigned variables and units.

For the 2D exercises import the reduced Generator CSV (ZIP), described in the 3D section. Use v0001 — tempo_s and v0003 — tensione_V for X and Y. In Auxiliary variable IDs (same dataset) enter the IDs, for example v0004 for the symmetric Y error, v0007 for the symmetric X error and v0005/v0006 for the band limits. The series can be saved with Enabled off and is then excluded from the plot. In the bar diagram use distinct abscissas. Select famiglia as Filter variable, press Refresh values and select a value before saving the series. This limits the series to the twenty abscissas of one family and resolves the rejection X vector values must be unique seen on the 200 rows together.

Symmetric error bars read from the auxiliary X and Y columns.
Symmetric error bars read from the auxiliary X and Y columns.
Bands built from the Y limits defined in the table.
Bands built from the Y limits defined in the table.
Bar chart with unique abscissas after the family filter.
Bar chart with unique abscissas after the family filter.
Voltage distribution with count normalization.
Voltage distribution with count normalization.
Box-and-whisker summary on the voltage column.
Box-and-whisker summary on the voltage column.
Title, styles and scales set in the Configure dialog of the 2D figure.
Title, styles and scales set in the Configure dialog of the 2D figure.

Try asymmetric amplitudes, widths and isolated points

Import the CSV with the auxiliary columns (ZIP) from Acquisition → Generic CSV, ID grafici.configurazioni and contract curve_family.table. It contains the same grid with additional fields computed for these exercises. If you change the primary source after setting up 3D, set the old 3D bindings to auto when you work in 2D only, or assign them explicitly to the new source. The preflight checks the stored bindings.

  • errorbar. Use X=v0001 and Y=v0003. Set the X and Y errors to asymmetric. In Y use v0004 and v0010, amplitudes 0.025 and 0.060 V. In X use v0007 and v0011, amplitudes 0.025 and 0.045 s. The plot reads the two sides from different columns.
  • bar. Use the same X/Y and a family with distinct abscissas. In Bar X lower and Bar X upper set v0008 and v0009. The bars extend between X−0.15 s and X+0.18 s around the sample.
  • box_whisker. Choose in Y v0012, a column that includes a teaching point at 22 V. With Show box outliers on 1 you can spot that point above the upper whisker. The box gives the characteristics of the column’s distribution.
Error bars with distinct amplitudes on the lower and upper sides.
Error bars with distinct amplitudes on the lower and upper sides.
Bars with explicit abscissa limits for each sample.
Bars with explicit abscissa limits for each sample.
Box plot with the teaching point at 22 V visible above the whiskers.
Box plot with the teaching point at 22 V visible above the whiskers.

Publish the 2D plot, save a selection and reopen it

  1. Close the dialogs, tick Run / recalculate now, check the plan in Run and start Run enabled analyses. Open Plots and select the row plot.dataset for 2D. The module PNG and the row in Plots represent the run. The canonical source in Dataset stays available for looking at all the samples.
  2. For an interval, open Data / Variants → Select data…, choose the series and drag between the two abscissas in the plot. Use Save Selection. In the test, saving produces sel_001 with X coordinates from about 219.687 to 240.647 s. The axis showed minutes. The conversion of the selection coordinates keeps the seconds of the source.
  3. Use Data / Variants → Select area for a rectangular region and Clear area to clear it, when the region is present. The rectangular 2D entry has its own graphics configuration. A saved selection can be used as an input, for example in Dataset Extract. In the receiving module check the saved series, axis and interval.
  4. To reopen the figure go back to Plots, select the right row, then use Graph → Open PNG 1:1. To apply presentation changes, save the variant options and use Render → Rerender.
Plot registered in the Plots tab after the 2D run.
Plot registered in the Plots tab after the 2D run.
Interactive selection of an interval on the calibrated plot.
Interactive selection of an interval on the calibrated plot.

Set X, Y, Z and 3D geometry

  1. In Dataset sources assign calibrated.family.source to primary. Enable Scientific dataset 3D. In Input variable bindings bind X explicitly to primary.x_s, Y to primary.family_parameter and Z to primary.y_V. The coordinates are seconds, a dimensionless parameter and volts. 3D Family / group variable can be primary.calibration_index to distinguish calibrations. Color variable C can be primary.y_V to encode the Z value with color as well.
  2. Open Configure… on the third row. In 3D plot type choose a geometry suited to the structure of the coordinates. Title and the three axis names can follow the variables with auto or use explicit text. Axes… opens the axis settings. Before the run, check the bindings and turn off the other figures if they do not have valid series yet.

To repeat the seven geometries on a small input, download the exercise CSV derived from the Generator (ZIP). It is a 200-row subset of calibration 0, with ten families and twenty abscissas per family. The additional error and limit columns are teaching aids assigned starting from 0.025 V and 0.025 s. Import from Acquisition → Generic CSV with ID grafici.campione and contract curve_family.table. For 3D assign tempo_s, famiglia and tensione_V to X, Y and Z. Choose famiglia also as the group for line3. For maps, contour lines or triangulation leave the group on auto so as to use all the X/Y pairs together. On line3 and contour3 also leave C on auto. In this configuration without an explicit C column both runs are accepted. heatmap requires the whole grid as a single set for this exercise.

Type
line3
Requirement and reading
Connects X, Y and Z in sequence, typically one sequence per family. Choose dataset_order or sort_x and check that the series jumps do not connect separate acquisitions.
Type
scatter3
Requirement and reading
Shows the triples as points without connecting them. Change Marker size to read the density of the cloud. A separate C allows a fourth visual quantity.
Type
surface, mesh
Requirement and reading
Uses a rectangular grid of X/Y pairs with one Z per vertex for the reproducible example. The surface fills the faces, the mesh highlights the connections. Before applying them to sparse measurements, check how gaps and duplicate pairs are handled.
Type
contour3
Requirement and reading
Shows contour lines of the Z values. Contour levels sets the number of levels, initially 12. Change the value to tell apart closely spaced structures.
Type
trisurf
Requirement and reading
Shows triangular faces for sparse coordinates. Use well-distributed X/Y pairs, without duplicates or global collinearity. Check the edges of the triangulation, where long connections can appear.
Type
heatmap
Requirement and reading
Represents the Z value on a planar X/Y map with a color scale. Use a grid with a known domain to read the values between samples.

For line3, mesh and contour lines adjust Line width. The legend offers auto, none, series, family and an explicit prefix for the family values. The additional export can be none, svg or pdf. With the 3D plot active, SVG and PDF write, respectively, 03_dataset_xyz.svg and 03_dataset_xyz.pdf next to the PNG. In Results check the extension produced; in Plots you find the rendered figure. The plot-specific reduction control also allows inherit. The 3D target accepts inherit or from 100 to 8,000,000 points. For the module’s 3D Family display unit choose auto or source to keep the source unit.

The Configure dialog offers seven 3D geometries.
The Configure dialog offers seven 3D geometries.

For surface and mesh, leave 3D Family / group variable on auto in the grid sample. Grouping on the same Y — the family parameter — leaves each group with a single row of the grid. Under these conditions the figure can be almost empty even with a completed run. Check the image in the Plots tab and configure the geometry on the whole grid.

For a variant on the 200 rows use sort_x, Legend content on family and prefix Teaching level. Use width 2 for line3 and marker 8 for scatter3. Set 3D display reduction on stride and target 120. Both runs report 110 points shown out of 200 valid. The module configuration stays on minmax and the plot override chooses stride. The two tests used, respectively, source and auto as the family unit. For the dimensionless parameter of the exercise the two modes keep the same scale.

Separate 3D lines per family parameter.
Separate 3D lines per family parameter.
Surface on the whole grid, without separation into families.
Surface on the whole grid, without separation into families.
Mesh for observing the connections between vertices.
Mesh for observing the connections between vertices.
Voltage contour lines obtained without a separate color column.
Voltage contour lines obtained without a separate color column.
Triangulation applied to all the X/Y pairs together.
Triangulation applied to all the X/Y pairs together.
Voltage map on the time and parameter grid, registered in Plots.
Voltage map on the time and parameter grid, registered in Plots.
3D scatter of the Generator in Plots. X is time, Y the family parameter and Z the voltage.
3D scatter of the Generator in Plots. X is time, Y the family parameter and Z the voltage.

Adjust axes, legend and annotations in Plots

Select the figure in Plots before opening Presentation. Title and labels… changes title and labels. Axes… opens Use plot-specific configuration, with displayed unit, minimum, maximum, step, format, scale and minor grid for X, left Y, right Y and Z. A manual choice narrows or reformats the view. Restore automatic returns to the automatic settings. For the 3D space, projection, azimuth, elevation, X/Y/Z aspect, color map, unit and color limits are available. In 2D the 3D view fields do not affect the drawing. Save and rerender plot applies the configuration and regenerates the image. Save keeps the fields and Cancel closes the dialog.

With Legend… uses a plot configuration to set position and arrangement. Placement sets where it appears. Legend layout sets alignment in a row, a column or wrapped. Wrapped columns applies to the wrapped arrangement. Inside preset sets the inside anchor. External alignment and External margin control anchor and distance outside. Use normalized X/Y centers from 0 to 1 only for manual positioning. Hexadecimal colors, border and text size complete the appearance. Place legend is used to position it on the plot when the figure supports it.

Graphics… opens the global graphics settings. To limit them to this analysis only, use Module graphics… from the Analysis tab. Annotate… opens the layer separate from the PNG. The properties of the selected object include visibility, lock, color and width, fill, text, font and rotation. Apply properties applies the changes to the layer. Undo and Redo step through the changes, Send back and Bring front change the stacking and Delete removes the object. Save JSON saves the annotation layer. For an image with the annotations use Import / Export → Export annotated….

To try the customization on the bar chart, enable the plot configuration in Axes…, set X to scale linear, minimum 1, maximum 8, step 1 and format %.1f. In Legend… set below and layout row. Save and regenerate: the image shows a narrower interval and the legend below the data area.

Figure before the change of X limits and legend position.
Figure before the change of X limits and legend position.
Same bars with X between 1 and 8 and the legend below the plot.
Same bars with X between 1 and 8 and the legend below the plot.

To check the resolution open Presentation → Graphics…, change Output width [px] and use Apply + rerender current plot. In testing the PNG went from 1600×900 to 1200×900 pixels. In Annotate… choose Text and click on the figure. For Line, Arrow, Rectangle and Ellipse, choose the tool and drag between the endpoints. Select reactivates object selection. After Save JSON, the editor keeps five objects in 01_dataset_xy.json. Undo before saving reduced the count to four and Redo brought it back to five.

Annotation layer created on Plot, with five objects and editing controls.
Annotation layer created on Plot, with five objects and editing controls.
Editor of the axes and 3D settings for the selected PNG.
Editor of the axes and 3D settings for the selected PNG.
Editor of the legend and its positioning.
Editor of the legend and its positioning.

Check the number of points drawn

In Calculation configuration → Large-dataset presentation reduction you can use auto to apply the reduction above the threshold, none for all valid points, stride to sample at intervals and minmax to keep the local extremes where the provider applies it. The Target display points is approximate, initially 6000. Reset restores the initial target. Auto reduction threshold starts at 12,000 valid rows. Dataset streaming chunk rows starts at 5000 and concerns the blocks read by the process. The run summary and the displayed geometry help you understand which reduction was applied. On the 200 rows of the rectangle exercise, stride with target 100 left 200 points in the summary of that series. minmax with target 100, threshold 150 and requested block 50 showed 134 points and an effective block of 100 rows. The report gives separately valid, display and reduction. To check a single measurement use the canonical source, especially when a narrow signal can be lost by interval sampling.