メモ
github: https://github.com/tocom242242/aifx_blog_codes/blob/master/matplotlib/lineCollection.ipynb
サンプルコード
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
start_pos = [[0,0], [3,3]]
end_pos = [[1,1], [5,8]]
lines = [ [sp,ep] for sp,ep in zip(start_pos, end_pos)]
colors = ["b", "r"]
lc = LineCollection(lines, colors=colors)
fig, ax = plt.subplots()
ax.add_collection(lc)
ax.autoscale()
plt.show()