#!/usr/bin/env python

import numpy as np
import pylab as pl
from matplotlib import collections  as mc

lines = [[(0, 1), (1, 1)], [(2, 3), (3, 3)], [(1, 2), (1, 3)]]
c = np.array([(1, 0, 0, 1), (0, 1, 0, 1), (0, 0, 1, 1)])
lc = mc.LineCollection(lines, colors=c, linewidths=2)

lines2 = [[(0.1, 1.1), (1.1, 1.1)], [(2.1, 3.1), (3.1, 3.1)], [(1.1, 2.1), (1.1, 3.1)]]
lc2 = mc.LineCollection(lines2, colors=[0,0,0],linewidths=1)

fig, ax = pl.subplots()
ax.add_collection(lc)
ax.add_collection(lc2)
ax.autoscale()
ax.margins(0.1)

pl.show()


