Improved function drawing.