On this page
- What the trapezoidal rule actually computes
- Choosing a baseline: Zero, Constant, or Endpoint Line
- Positive-only (iAUC) vs signed net integration
- Sampling bias, curvature, and common AUC traps
- Comparing Autoplot, GraphPad Prism, OriginPro, and SciPy
- AUC - Area Under Curve in Autoplot
- Frequently asked questions
What the trapezoidal rule actually computes
For ordered finite coordinate pairs inside an integration window with and reference baseline , discrete composite trapezoidal integration approximates the continuum integral as a sum of straight chord trapezoids between consecutive samples:
Each step weights the average effective height by the local spacing , so the method works directly on uneven time points (such as sparse clinical blood draws or variable dwell times) without resampling onto a uniform grid first. As Matthews et al. (1990) emphasize for serial biomedical measurements, this simplicity lets AUC summarize overall response without forcing a parametric pharmacokinetic model onto noisy individual subjects.
In Autoplot (buildAUCResult), raw (X, Y) pairs are first zip-paired, filtered to finite values, sorted in ascending order, and evaluated strictly in the data's natural linear units rather than transforming coordinates into . When xmin or xmax falls between two adjacent measured coordinates and , Autoplot linearly interpolates the boundary value inside :
No extrapolation is performed outside the measured data range, and nearly coincident points within in are deduplicated before summation so vertical step artifacts do not double-count boundaries.
Choosing a baseline: Zero, Constant, or Endpoint Line
Before looking at any numerical area, inspect what counts as zero response on the y-axis. Three baseline models cover most laboratory and clinical traces:
| Baseline mode | Reference formula | When to use it | Watch out for |
|---|---|---|---|
Zero | Absolute zero is physically exact (zeroed detector counts, calibrated concentration above zero) | Adds pre-stimulus offset directly into total area | |
Constant | Trace sits on a steady dark level, blank reading, or fasting baseline | Must supply an explicit numeric Value; wrong scales linearly with window width | |
Endpoint Line | Linearly drifting background (thermal drift, HPLC gradient ramp, bleaching slope) anchored at | Anchors directly on interpolated and ; noisy edge points tilt the chord |
If a noisy tail fluctuates at or , inspect whether shifting the window slightly alters Endpoint Line, or switch to full multi-component modeling via multi-peak fitting and peak deconvolution when neighboring peaks overlap the baseline flanks. For broader model choice decisions before committing to an integration rule, see how to fit a curve to data.
Positive-only (iAUC) vs signed net integration
Measured traces often cross below their baseline—for example postprandial glucose dipping below fasting level, biphasic action potentials, or detector undershoot after an impulse. The choice between positive-clamped and signed integration depends on whether excursions below cancel positive signal:
- Positive-only incremental AUC (clamped at zero): sets at each node inside . Because negative samples clamp to zero rather than cancelling positive lobes, both the reported area and plotted shading show strictly positive excursion above the baseline (as in the unshaded tail past above). Notice that if the raw trace steps from above baseline to below baseline across one interval , linear nodal clamping uses the trapezoid connecting and rather than solving for the exact zero-crossing root inside the step.
- Signed net AUC (negative excursions included): keeps the raw difference with sign intact. Negative deviations subtract directly from positive peaks, which matches conserved quantities whose integral should recover zero when upward and downward fluctuations balance.
Wait until the baseline level itself is verified before toggling negative-area inclusion: setting Constant too high artificially pushes legitimate signal tail below the baseline and hides real exposure if negative area stays clamped.
Sampling bias, curvature, and common AUC traps
Even when discrete formulas match software output to machine precision, four numerical traps distort physical conclusions:
- Coarse sampling across sharp maxima and exponential tails: linear segments cut below a concave-down peak and cut above a concave-up elimination decay. As Yeh and Kwan (1978) and Purves (1992) demonstrate on pharmacokinetic concentration curves, linear trapezoidal quadrature slightly overestimates concave-up exponential tails unless log-trapezoidal steps or dense sampling are used, whereas splines can ring across abrupt transitions. Densify acquisition near rather than trusting coarse linear chords across a narrow spike.
- Comparing areas integrated on different windows: cannot be compared directly against unless the response has genuinely returned to baseline across both intervals. Fix identical bounds and baseline rules across experimental cohorts.
- Integrating heavily sloped curves in log space without noticing: plotting a curve on logarithmic axes does not turn linear trapezoidal AUC into a log-spaced integral. If your curve spans decades in and , inspect spacing in natural units first or review log binning before aggregating wide tails.
- Assuming raw max equals peak over baseline: Autoplot tracks
peak in rangeas the maximum raw sample inside (x = 2,y = 9.13966above), not . Subtractbaseline valueexplicitly when reporting baseline-corrected peak amplitude.
Comparing Autoplot, GraphPad Prism, OriginPro, and SciPy
All four tools compute composite trapezoidal area reliably, so choose by workflow fit and downstream analysis depth:
| Tool | Mac app | Baseline and window handling | Best workflow fit |
|---|---|---|---|
| Autoplot | Native Apple silicon | Zero, Constant, Endpoint Line; positive-only or signed; interpolated [xmin, xmax] | Interactive single-curve shaded AUC with peak readout and clean export |
| GraphPad Prism | Native macOS | Y = 0 or constant baseline with total, net, and peak statistics | Paired pharmacology cohorts with built-in replicate summary tables |
| OriginPro | Windows without VM | Interactive baseline subtraction and multi-peak batch integration | High-throughput spectroscopy and multi-peak area matrices |
| SciPy / NumPy | Native Python CLI | Array subtraction y - b with trapezoid and np.interp | Custom log-trapezoidal, spline quadrature, and automated pipelines |
Keep GraphPad Prism when you need replicate-table PK statistics across many subjects at once, keep OriginPro when processing high-throughput multi-peak spectroscopy batches, and use scipy.integrate.trapezoid or numpy.trapezoid when a pipeline requires custom spline or log-trapezoidal quadrature. Use Autoplot when you want interactive [xmin, xmax] window shading, instant switches between Zero, Constant, and Endpoint Line baselines, and crisp figure composition on macOS without writing plotting boilerplate.
AUC - Area Under Curve in Autoplot
Autoplot's AUC - Area Under Curve layer (Run Analysis → AUC - Area Under Curve inside any X&Y Plot, Plus — free for 30 days) computes exact interpolated trapezoidal integration locally on your Mac:
- Inputs (
Source&Integration): chooseXandYvariables, setxminandxmaxin natural units (blank bounds default to the full sampled span), pickZero,Constant(Value), orEndpoint Line, and toggleInclude negative areabetween positive-clamped and signed net summation. - Visual overlays (
Mark & stroke&Label & legend): toggleCurve, semi-transparentFillopacity,Baselineline, and verticalBounds(xmin/xmax) lines with independent colors, widths, andSolid/Dotted/Fine Dottedstrokes, plus legend entry labels. - Readouts (
Figure Inspector → Results): view integratedarea, effectiverange,baselinemode and optional value, negative-area flag, interpolatedpoints used, and rawpeak in range(x,y), with one-click copy to clipboard. - Where it stops: Autoplot uses unweighted linear trapezoidal summation with nodal positive clamping (); exact sub-interval zero-crossing interpolation, piecewise log-trapezoidal rules, spline quadrature, and batch multi-curve AUC summary tables are better handled in a custom
scipy.integrate.trapezoidscript or dedicated PK table tool.
Frequently asked questions
| How does Autoplot handle xmin or xmax when it falls between sampled rows? | Autoplot sorts finite (X, Y) pairs ascending by and uses linear interpolation between the two bracketing samples whenever xmin or xmax lies inside . Bounds outside the sampled span do not extrapolate beyond the data endpoints. |
|---|---|
| What is the difference between Endpoint Line and Constant baselines? | Constant holds a flat horizontal reference across the entire window using your entered numeric Value, whereas Endpoint Line constructs a linear ramp connecting at the start of the window to at the end so tilted background drift is removed before integration. |
| Does Include negative area change how the shaded area looks on the plot? | Yes. When Include negative area is off, both the numerical area and the shaded band clamp sub-baseline points to zero so dips below the baseline remain unshaded and contribute zero to the integral. When enabled, sub-baseline excursions subtract from the sum and appear shaded on the opposite side of the baseline. |
| Is the reported peak in range baseline-subtracted? | No. Both peakX and peakY in the card footer and Figure Inspector → Results report the coordinates of the maximum raw regionY point inside , so subtract or manually if you need peak height above baseline. |
Sources
Algorithm details (buildAUCResult, finite XY zip-sorting, [xmin, xmax] linear interpolation without endpoint extrapolation, -coordinate deduplication, Zero/Constant/Endpoint Line baselines, nodal positive clamping max(0, y - b) vs signed integration, and raw peakX/peakY) and UI labels (AUC - Area Under Curve, Integration, Include negative area, Mark & stroke, Figure Inspector → Results) were verified directly against Autoplot 2.5.2 source (DataModel.swift, FigureContentView.swift, FigurePlotView.swift, and Autoplot's AUC integration documentation) on 27 November 2026. Reference trapezoidal quadrature documentation uses SciPy's scipy.integrate.trapezoid and NumPy's numpy.trapezoid. Linear vs log-trapezoidal and spline bias analyses draw on K. C. Yeh and K. C. Kwan, "A comparison of numerical integrating algorithms by trapezoidal, Lagrange, and spline approximation," Journal of Pharmacokinetics and Biopharmaceutics 6(1), 79–98 (1978), DOI 10.1007/bf01066064, and R. D. Purves, "Optimum numerical integration methods for estimation of area-under-the-curve (AUC) and area-under-the-moment-curve (AUMC)," Journal of Pharmacokinetics and Biopharmaceutics 20(3), 211–226 (1992), DOI 10.1007/bf01062525; and serial biomedical AUC summary analysis draws on J. N. Matthews, D. G. Altman, M. J. Campbell, and P. Royston, "Analysis of serial measurements in medical research," BMJ 300(6719), 230–235 (1990), DOI 10.1136/bmj.300.6719.230.