當前位置: 首頁>>代碼示例>>Python>>正文


Python Line.color方法代碼示例

本文整理匯總了Python中boomslang.Line.color方法的典型用法代碼示例。如果您正苦於以下問題:Python Line.color方法的具體用法?Python Line.color怎麽用?Python Line.color使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在boomslang.Line的用法示例。


在下文中一共展示了Line.color方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: constructImage

# 需要導入模塊: from boomslang import Line [as 別名]
# 或者: from boomslang.Line import color [as 別名]
    def constructImage(self):
        plot = Plot()

        # Uneven error bars
        line = Line()
        line.xValues = [6,10,4,0,8,2,12]
        line.yValues = [50,90,30,10,70,20,110]
        line.yMins   = [y - 30 for y in line.yValues]
        line.yMaxes  = [y + 50 for y in line.yValues]
        line.label = "Asymmetric Errors"
        line.color = "red"

        # Even error bars
        line2 = Line()
        line2.xValues = [1,5,3,9,7,11]
        line2.yValues = [100, 120, 110, 140, 130, 150]
        line2.color = "blue"
        line2.label = "Symmetric Errors"
        line2.yErrors = [5,25,15,45,35,55]

        plot.add(line)
        plot.add(line2)
        plot.xLabel = "X Label"
        plot.yLabel = "Y Label"
        plot.hasLegend()
        plot.xLimits = (-1, 13)
        plot.save(self.imageName)
開發者ID:alexras,項目名稱:boomslang,代碼行數:29,代碼來源:test_errorbars.py

示例2: main

# 需要導入模塊: from boomslang import Line [as 別名]
# 或者: from boomslang.Line import color [as 別名]
def main():

    output_graph = sys.argv[1]

    plot = Plot()
    plot.hasLegend(location='lower right')
    plot.xLabel = 'Per-client throughput (Mbps)'  # Change this
    plot.yLabel = 'CDF'
    plot.xLimits = (0, 50)
    plot.yLimits = (0, 1)
    plot.legendLabelSize = FONT_SIZE
    plot.xTickLabelSize = FONT_SIZE - 2
    plot.yTickLabelSize = FONT_SIZE - 2
    plot.axesLabelSize = FONT_SIZE
    
    for csv_file in sys.argv[2:]:
        
        cdf_table = _make_cdf(csv_file)
        
        line = Line()
        line.xValues = [x for (x, _) in cdf_table]
        line.yValues = [y for (_, y) in cdf_table]
        line.color = colors.pop(0)
        line.lineStyle = line_styles.pop(0)
        
        # Extract the filename
        line.label = capitalize( csv_file.split('/')[-2].replace('.csv', '') )
        plot.add(line)
        
    plot.save(output_graph)
開發者ID:crazyideas21,項目名稱:swclone,代碼行數:32,代碼來源:plot_cdf.py

示例3: constructImage

# 需要導入模塊: from boomslang import Line [as 別名]
# 或者: from boomslang.Line import color [as 別名]
    def constructImage(self):
        line1 = Line()
        line1.xValues = range(7)
        line1.yValues = [1, 2, 4, 8, 16, 32, 64]
        line1.label = "First Plot"
        line1.lineStyle = "-"
        line1.color = "red"

        line2 = Line()
        line2.xValues = range(7)
        line2.yValues = [100, 90, 80, 70, 60, 50, 40]
        line2.label = "Second Plot"
        line2.lineStyle = "--"
        line2.color = "blue"

        plot = Plot()
        plot.add(line1)
        plot.add(line2)
        plot.xLabel = "Shared X Axis"
        plot.yLabel = "First Plot's Y Axis"
        plot.setTwinX("Second Plot's Y Axis", 1)
        plot.hasLegend()

        plot.save(self.imageName)
開發者ID:alexras,項目名稱:boomslang,代碼行數:26,代碼來源:test_twinx.py

示例4: Plot

# 需要導入模塊: from boomslang import Line [as 別名]
# 或者: from boomslang.Line import color [as 別名]
#!/usr/bin/env python

from boomslang import Line, Plot

plot = Plot()

# Uneven error bars
line = Line()
line.xValues = range(6)
line.yValues = [25, 21, 30, 23, 10, 30]
line.yMins = [10, 18, 10, 10, 5, 20]
line.yMaxes = [30, 50, 40, 30, 20, 45]
line.label = "Asymmetric Errors"
line.color = "red"

line.xValues = range(len(line.yValues))

# Even error bars
line2 = Line()
line2.xValues = range(6)
line2.yValues = [35, 40, 45, 40, 55, 50]
line2.color = "blue"
line2.label = "Symmetric Errors"
line2.yErrors = [3, 6, 5, 3, 5, 4]

plot.add(line)
plot.add(line2)
plot.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.hasLegend()
plot.save("errorbars.png")
開發者ID:crazyideas21,項目名稱:dev,代碼行數:33,代碼來源:errorbars.py

示例5: range

# 需要導入模塊: from boomslang import Line [as 別名]
# 或者: from boomslang.Line import color [as 別名]
        for test in client_data:
            if u'success' in test:
                client_run.append(test[u'end_time'] - test[u'start_time'])
            else:
                client_run.append(0)
        runs.append(client_run)

average_run = []
for i in range(0, len(runs[0])):
    average_run.append(sum([a_run[i] for a_run in runs])/len(runs))

print average_run
plot = Plot()

for run in runs:
    line = Line()
    line.yValues = run
    line.xValues = list(range(0, len(run)))
    plot.add(line)

# Also add in the average line
avg_line = Line()
avg_line.yValues = average_run
avg_line.xValues = list(range(0, len(run)))
avg_line.color = 'r'
plot.add(avg_line)

plot.xLabel = "Test Index"
plot.yLabel = "Miliseconds"
plot.save(os.path.join(data_dir, "graph.png"))
開發者ID:snyderp,項目名稱:drano-stress-tests,代碼行數:32,代碼來源:graph_results.py


注:本文中的boomslang.Line.color方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。