Implement plotting code for discontinuous functions