Although pgfplots supports discontinuities, the method described in the manual is only applicable for the zero crossing and is unable to handle data on both sides of the singularity. As I needed this functionality, I came up with this small hack. The code is rather ugly, the result is not. […]