Advanced Octave A40 — Annotations and regions of interest
Advanced GNU Octave with GX-TXT · Module 07
A reference line and a highlighted band help to read a chart without altering the measurements. The annotations must make the comparison clearer, leaving the values outside the chosen range visible.
Objectives and prerequisites
We use the Synthetic Dataset octave_advanced_batch_a created in A14 and the bases of the PlotSpec introduced in A37. The example is run with GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import riferimenti.m, register it and run it in the Runner.
A line and a region
The list panel.annotations contains two structures. The first, reference_line on the x axis, identifies 1 s. The second, reference_region on the left axis, highlights the range between 1.1 and 1.3 V with 0.12 opacity. These values are expressed in the coordinates of the axes displayed. References belong to the panel and do not constitute additional data series.
The script validates the spec, creates a variant and sets units and axes limits. In the execution the validation returned 1. Open the result from Plots tab:
The dotted line crosses the point to 1 s and the grey band includes the values from 1.1 to 1.3 V. In the figure the references are recognized by the positions on the axes: the explanation of their meanings is provided in the text. The curve and the points remain visible even outside the band. This band is chosen for example and does not represent a scientific or regulatory threshold.
Two types of annotation
The reference annotations of the PlotSpec use coordinates of the displayed axles. The framework also has a separate graphic annotation level, described by PLOT_ANNOTATION_API_v1, which uses standardized coordinates of the figure: the two systems have different purposes and coordinates. A scientific reference to a specific value must clearly preserve the unity and meaning of the threshold.
Exercise
- What is the vertical line?
- Is the point 2 s in the highlighted band?
- What changes in the Source Dataset when we add these references?
Worked solution
- The time reference of 1 s, chosen for the example.
- No: the value is 1.4 V, higher than 1.3 V.
- Nothing: line and band are presentation settings, not modifications of the measures.
Other steps of this project
- Advanced Octave A75 — Dynamical systems in phase space
- Advanced Octave A81 — Geography of the waves and a 3D surface
- Advanced Octave A82 — Age, sex and demographic inequalities
- Advanced Octave A83 — All-cause mortality, certified COVID deaths and surveillance
- Advanced Octave A84 — A reproducible public account
- Advanced Octave A73 — Optimization landscapes and 3D trajectories