charts - D3 - Difference between basis and linear interpolation in SVG line -


i implemented multi-series line chart 1 given here m. bostock , ran curious issue cannot explain myself. when choose linear interpolation , set scales , axis correct , values well-aligned. linear interpolation

but when change interpolation basis, without modification of axis , scales, values between lines , axis incorrect.

basis interpolation

what happening here? monotone setting can achieve pretty same effect basis interpolation without syncing problem between lines , axis. still understand happening.

the basis interpolation implementing beta spline, people use interpolation function precisely because smooths out extreme peaks. useful when modeling expect vary smoothly have sharp, infrequently sampled data. consequence of resulting line not connect data points, changing appearance of extreme values.

in case, sharp peaks interesting features, exception typically 0 baseline value. when use spline interpolation, smoothing on these peaks.

here fun demo play different types of line interpoations: http://bl.ocks.org/mbostock/4342190

you can drag data around resemble sharp peak yours, click add new points. then, switch basis interpolation , watch peak averaged out.

basis interpolation


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -