How to plot a path according to a function in scene view

given a function e.g x^2 , in what ways can I draw a discrete path from point a to b with interval h, all within scene view? (pic)
77029-plott.png

do I simply run a for loop , i from a to b with step h, whenever a change in function is detected and instantiate GameObjects at f(i) ?

you can run a simple loop and use Handles.DrawLine from OnSceneGUI in an editor script.