Sketch gradient function for a given curve (#901)