New curve plotting algorithm
Function plotting