plot.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CElegansBehaviour 作者: ChristophKirst 项目源码 文件源码
def plot_colored_line(x,y, color, cmap = 'spectral_r', line_width = 2):
  """Plot a line with color code"""
  segments = np.array([x, y]).T.reshape(-1, 1, 2);
  segments = np.concatenate([segments[:-1], segments[1:]], axis=1);
  lc = LineCollection(segments, cmap=cmap);
  lc.set_array(np.array(color));
  #lc.set_linewidth(line_width);
  plt.gca().add_collection(lc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号