Do you mean something like this?
import pylab
xdata = [0, 1, 2, 3, 4, 5]
ydata = [0, 1, 2, 2, 1, 0]
# Assuming xdata, ydata are of suitable length and type
plots = [pylab.plot(xdata[i:i + 2], ydata[i:i + 2], **whatever_keyword_arguments) for i in xrange(0, len(xdata), 2)]
pylab.show()
Edit after OP edit:
I see what you mean, and it's trivial to add the lines in dashes.
def plot_broken(xseq, yseq, even=True, **plot_kwargs):
size = len(xseq)
assert size == len(yseq)
assert size % 2 == 0
start = 0 if even else 1
return [pylab.plot(xseq[i:i + 2], yseq[i:i + 2], **plot_kwargs)
for i in xrange(start, size, 2)]
plots = plot_broken(xdata, ydata, even=True, color="m",
linestyle="solid")
plots += plot_broken(xdata, ydata, even=False, color="m",
linestyle="dashed")