当前位置: 首页>>代码示例>>Python>>正文


Python LineCollection.color方法代码示例

本文整理汇总了Python中matplotlib.collections.LineCollection.color方法的典型用法代码示例。如果您正苦于以下问题:Python LineCollection.color方法的具体用法?Python LineCollection.color怎么用?Python LineCollection.color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.collections.LineCollection的用法示例。


在下文中一共展示了LineCollection.color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot_curve

# 需要导入模块: from matplotlib.collections import LineCollection [as 别名]
# 或者: from matplotlib.collections.LineCollection import color [as 别名]
def plot_curve(x, color=None, label=None, ax=None):
    points = zip(1 - x[1], 1 - x[0])
    segments = zip(points[:-1], points[1:])
    if ax is None:
        ax = axes(frameon=True)
    LC = LineCollection(segments, label=label)
    if not (color is None):
        LC.color(color)
    ax.add_collection(LC)
    axis([0, 1, 0, 1])
开发者ID:stucchio,项目名称:connect-the-surfels-paper,代码行数:12,代码来源:misc.py

示例2: drawBarPlot

# 需要导入模块: from matplotlib.collections import LineCollection [as 别名]
# 或者: from matplotlib.collections.LineCollection import color [as 别名]
 def drawBarPlot(self):
     """Rysuje główny wykres w postaci barowej."""
     if self.data==None or self.data.corrupted:
         return
     ax=self.mainPlot
     x=range(len(self.data.close))
     lines1=ax.vlines(x,self.data.low,self.data.high,label=self.data.name)
     lines2list=[]
     for i in x:
         lines2list.append(((i-0.3,self.data.open[i]),(i,self.data.open[i])))
         lines2list.append(((i,self.data.close[i]),(i+0.3,self.data.close[i])))   
     lines2=LineCollection(lines2list)
     lines2.color('k')
     ax.add_collection(lines2)
开发者ID:WallStreetFighters,项目名称:WallStreetFighters,代码行数:16,代码来源:Chart.py

示例3: axes

# 需要导入模块: from matplotlib.collections import LineCollection [as 别名]
# 或者: from matplotlib.collections.LineCollection import color [as 别名]

ax = axes(subplot(212))
curves, edges = ctd.curvature_connect( pts, curvature, 0.5*dt*sqrt(2), err*0.85, 10)

for points in curves:
    segments = []
    for i in range(len(points)):
        p = points[i]
        #arrow(p[0],p[1],0.1*p[2],0.1*p[3], ec=clrs[ci])
        if i < len(points)-1:
            p2 = points[i+1]
            segments.append( [(p[0],p[1]), (p2[0], p2[1])])
    segments.append( [(points[-1][0], points[-1][1]), (points[0][0], points[0][1])])
    LC = LineCollection(segments)
    LC.color(clrs[ci])
    ax.add_collection(LC)

    ci = (ci + 1) % len(clrs)

LC = LineCollection(edges)
LC.color('black')
ax.add_collection(LC)

ax.set_xlim(-0.9,1.0)
ax.set_ylim(-0.6,0.6)
title("Reconstructed curves")
## ax.set_xlim(0.25,0.45)
## ax.set_ylim(-0.1,0.1)

开发者ID:stucchio,项目名称:connect-the-surfels-paper,代码行数:30,代码来源:more_noisy_example.py


注:本文中的matplotlib.collections.LineCollection.color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。