How can I modify ListPlot so that I can plot joined data, but exclude joining up adjacent data points that differ by a certain threshold.
E.g. I want to modify the code
ListPlot[Table[Tan[x], {x, -Pi, Pi, 0.01}], Joined -> True] so that I don't see the vertical lines at the discontinuities (figure below). I understand this is often taken care of automatically in Plot and can be adapted to one's needs, but I'm not sure how to implement this with ListPlot.
Edit
The answer provided by @corey979 works for this simple example, but isn't suitable for my particular application (I don't want to get bogged down in the details unless necessary). I have an idea that will work for a general discontinuity but not sure how to implement it. Say instead I have the plot given by
f[x_] := If[x < 0, 0, 1] t1 = Table[f[x], {x, -1, 1, 0.01}]; ListPlot[t1, Joined -> True, DataRange -> {-1, 1}] how can I get rid of this discontinuity by telling ListPlot to not join the two points either side of 0?






