Skip to content

Instantly share code, notes, and snippets.

@migsalazar
Created June 5, 2016 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save migsalazar/9c20c11359de10a922dabf0c49f67524 to your computer and use it in GitHub Desktop.
Save migsalazar/9c20c11359de10a922dabf0c49f67524 to your computer and use it in GitHub Desktop.
Plotting with Canvas
context.beginPath();
for (var x = xstart; x < width; x++) {
xreal = (x / (xorigin)) - x0,
yreal = height - ((f(xreal) - y0) * _yscale);
context.lineTo(xreal, yreal);
}
context.stroke();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment