本文整理汇总了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])
示例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)
示例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)