Learn about linear and cubic curves as well as the unique value of Steffen's monotonic cubic method.
Interpolation is a mathematical technique used to estimate values between a set of known data points. It is commonly applied in fields like data visualization, numerical analysis, and physics to create smooth transitions or fill gaps in data.
In data visualization, interpolation determines how lines are drawn between discrete data points in charts, particularly in line charts, area charts, and smooth curves. The choice of interpolation method significantly affects both the visual appearance and the implied meaning of your visualization.
The most straightforward method of interpolation is linear interpolation, where straight-line segments connect adjacent data points. While effective and easy to compute, linear interpolation lacks smoothness, resulting in a "piecewise" appearance that may not align with the natural trend of the data.
To address this, methods like cubic interpolation use polynomials to produce smooth curves. However, these methods can introduce new challenges, such as violating "monotonicity" in the data.
Monotonicity refers to a series of values that either consistently increase or decrease in value. For example, a cumulative rainfall total is monotonically increasing.
When interpolating between data points, a curve that preserves monotonicity respects the natural direction of the data, maintaining its increasing or decreasing behavior. While cubic methods of interpolation create smooth, pleasing curves, they often violate monotonicity by producing spurious dips or peaks that are not present in the actual data.
Different interpolation methods make different assumptions about the behavior of data between known points, and choosing the right method is crucial for accurately representing your data's underlying patterns.
Linear interpolation connects data points with straight line segments, creating a piecewise linear function where the line between any two points follows the shortest path.
Characteristics:
Best used when:
Cubic interpolation uses cubic polynomials to create smooth curves between data points. This method considers not just the adjacent points but also the broader context to create smooth, continuous curves.
Characteristics:
Best used when:
To address these challenges, Matthias Steffen's monotonic cubic interpolation method modifies standard cubic interpolation to preserve monotonicity while maintaining smoothness. Introduced in the paper "A Simple Method for Monotonic Interpolation in One Dimension" (1979), the method ensures:
This is achieved by constraining the first derivatives (slopes) at each data point to avoid overshoots or reversals in the curve.
Key advantages:
Best used when:
In Mappica, line and area charts can be constructed using Steffen's interpolation method by selecting the "Monotone Cubic" curve option.
The choice of interpolation method should align with both your data characteristics and your communication goals:
Use Linear Interpolation when:
Use Cubic Interpolation when:
Use Steffen's Monotonic Cubic when:
When implementing interpolation in Mappica:
Understanding interpolation helps you make informed decisions about how to represent the relationships and trends in your data, ensuring your visualizations are both accurate and effective.