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


Python LinePlot.gridFirst方法代码示例

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


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

示例1: Drawing

# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import gridFirst [as 别名]
COMMENT_CHARS = b'#:'

drawing = Drawing(400, 200)
data = []
for line in urlopen(URL).readlines():
    if not line.isspace() and not line[0] in COMMENT_CHARS:
        data.append([float(n) for n in line.split()])
        

pred = [row[2] for row in data]
high = [row[3] for row in data]
low = [row[4] for row in data]
times = [row[0] + row[1]/12.0 for row in data]

lp = LinePlot()
lp.gridFirst = True
lp.x = 50
lp.y = 50
lp.height = 125
lp.width = 300
lp.data = [list(zip(times, pred)), list(zip(times, high)), list(zip(times, low))]
lp.lines[0].strokeColor = colors.blue
lp.lines[0].symbol = makeMarker('FilledCircle', size=3)
lp.lines[0].name = 'Predict'
lp.lines[1].strokeColor = colors.red
lp.lines[1].symbol = makeMarker('FilledCircle', size=3)
lp.lines[1].name = 'High'
lp.lines[2].strokeColor = colors.green
lp.lines[2].symbol = makeMarker('FilledCircle', size=3)
lp.lines[2].name = 'Low'
开发者ID:zlhou001,项目名称:Sunspots,代码行数:32,代码来源:main.py


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