Basic plotting from javascript in 2d canvas