diff --git a/plot.ts b/plot.ts index 46bddc3..b47c947 100644 --- a/plot.ts +++ b/plot.ts @@ -9,7 +9,7 @@ export const plot = (data) => { } export const plotxy = (xmin, xmax, step, y) => { - const x = Array.from({length: (xmax - xmin)/step}, (_, i) => (i + xmin) * step) + const x = Array.from({length: (xmax - xmin)/step}, (_, i) => i * step + xmin) const data = x.map(x => ({x, y: y(x)})) return Plot.line(data, {x: "x", y: "y"}).plot({y: {grid: true}, document}) } \ No newline at end of file