debugged plotting of pwl