Documentation

Calibration mathematics#

This page explains the transformation behind Fast calibration, Perspective calibration, and Logarithmic axes, rather than their placement workflow.

Coordinate systems and Fast calibration#

Fast calibration builds an affine image-space basis from the line through X1–X2 and the line through Y1–Y2. Their intersection is an image-space origin p0p_0; it need not represent graph (0,0)(0,0). With the two reference-line vectors exe_x and eye_y, an image point is represented as

p=p0+uex+vey.p = p_0 + u e_x + v e_y.

GraphX solves the two-dimensional basis parameters (u,v)(u,v) from the image point, then maps each parameter to its graph-axis value. This is why Fast calibration supports rotated graphs, unequal scales, reversed axes, and non-perpendicular/sheared image axes. It is not a horizontal/vertical bounding-box mapping. The two basis directions must not be parallel.

For a linear axis, interpolation between values v1v_1 and v2v_2 is v(t)=v1+t(v2−v1)v(t)=v_1+t(v_2-v_1). Negative direction or reversed values simply make the corresponding slope negative.

For a logarithmic axis, GraphX interpolates in natural-log value space:

v(t)=exp⁡(ln⁡(v1)+t[ln⁡(v2)−ln⁡(v1)]).v(t)=\exp(\ln(v_1)+t[\ln(v_2)-\ln(v_1)]).

The log base is immaterial when used consistently. Reference and graph values must be positive.

Perspective calibration#

Perspective calibration maps a rectified unit plot, with (0,0)(0,0) at top-left and (1,1)(1,1) at bottom-right, to the four-corner image quadrilateral. It uses a homography HH in homogeneous coordinates:

[x′y′w]=H[uv1],(x,y)=(x′w,y′w).\begin{bmatrix}x'\\y'\\w\end{bmatrix}=H\begin{bmatrix}u\\v\\1\end{bmatrix},\qquad (x,y)=\left(\frac{x'}w,\frac{y'}w\right).

The inverse homography rectifies an image point before the X and Y value transforms are applied. The forward homography projects graph values back to the image. This corrects planar perspective in a photographed plot, but cannot correct arbitrary paper curvature or lens distortion.

Inverse transforms and extrapolation#

GraphX provides both image-to-graph and graph-to-image transforms. They support digitising, direct coordinate editing, crosshair geometry, trendline drawing, and report overlays. The transform remains mathematically evaluable outside the calibrated plot boundary, so GraphX can label a point as extrapolated. That is geometry, not a guarantee that the extrapolated graph value is reliable.