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


Python Plot.yLabel方法代码示例

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


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

示例1: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.xLabel = "X Data"
        linePlot.yLabel = "Y Data"
        linePlot.title = "Data as Line"

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.xLabel = "X Data"
        barPlot.yLabel = "Y Data"
        barPlot.title = "Data as Bars"

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.xLabel = "X Data"
        scatterPlot.yLabel = "Y Data"
        scatterPlot.title = "Data as Points"

        layout = WeightedPlotLayout()
        # Plots in the same grouping are placed together on the same line
        layout.addPlot(linePlot, grouping="topRow", weight=2)
        layout.addPlot(barPlot, grouping="topRow")

        # Plots without a grouping are arranged as follows:

        # * While you can make a row of N plots, where N is the size of the plot
        # grouping with the largest size, do so.

        # * If you can't make a row of N plots, make the plots stretch across a
        # single row.

        layout.addPlot(scatterPlot)

        layout.save(self.imageName)
开发者ID:h8liu,项目名称:boomslang,代码行数:50,代码来源:test_weightedlayout.py

示例2: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [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

示例3: main

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [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

示例4: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.yValues = [25, 40, 30, 23, 10, 50]
        line.xValues = range(len(line.yValues))

        plot = Plot()
        plot.add(line)
        plot.xLabel = "X Label"
        plot.yLabel = "Y Label"
        plot.yLimits = (0, 60)
        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:13,代码来源:test_simpleline.py

示例5: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        plot = Plot()

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 8, 4, 6, 5]

        plot.add(bar)
        plot.xLabel = "Widget ID"
        plot.yLabel = "# Widgets Sold"

        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:14,代码来源:test_bar.py

示例6: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.xLabel = "X Data"
        linePlot.yLabel = "Y Data"
        linePlot.title = "Data as Line"

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.xLabel = "X Data"
        barPlot.yLabel = "Y Data"
        barPlot.title = "Data as Bars"

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.xLabel = "X Data"
        scatterPlot.yLabel = "Y Data"
        scatterPlot.title = "Data as Points"

        layout = PlotLayout()

        layout.addPlot(linePlot, grouping="topRow")
        layout.addPlot(barPlot, grouping="topRow")

        layout.addPlot(scatterPlot)

        layout.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:42,代码来源:test_layout.py

示例7: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        plot = Plot()

        line = Line()
        line.yValues = [25, 40, 30, 23, 10, 50]
        line.xValues = range(len(line.yValues))
        line.xTickLabels = ["X 1", "X 2", "X 3", "X 4", "X 5"]
        line.yTickLabels = ["Y Ten", "Y Twenty", "Y Thirty", "Y Forty",
                            "Y Fifty", "Y Sixty"]
        line.yTickLabelPoints = [10, 20, 30, 40, 50, 60]

        # You can set tick label properties with a dictionary ...

        line.xTickLabelProperties = {
            "color" : "blue",
            "weight" : "bold",
            "rotation" : 45
            }

        line.yTickLabelProperties = {
            "style" : "italic",
            "alpha" : 0.5,
            "color" : "red"
            }

        # (clearing for demonstrative purposes)
        line.xTickLabelProperties.clear()
        line.yTickLabelProperties.clear()

        # You can also set by direct elementwise access

        line.xTickLabelProperties["color"] = "blue"
        line.xTickLabelProperties["weight"] = "bold"
        line.xTickLabelProperties["rotation"] = "45"

        line.yTickLabelProperties["style"] = "italic"
        line.yTickLabelProperties["alpha"] = 0.5
        line.yTickLabelProperties["color"] = "red"

        plot.add(line)
        plot.title = "Craaazy Title"
        plot.setTitleProperties(
            style="italic", weight="bold", rotation="5",
            color="orange")
        plot.xLabel = "X Label"
        plot.yLabel = "Y Label"
        plot.yLimits = (0, 60)
        plot.tight = True

        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:52,代码来源:test_tickstyles.py

示例8: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        plot = Plot()

        line = Line()
        line.yValues = [25, 40, 30, 23, 10, 50]
        line.xValues = range(len(line.yValues))

        plot.add(line)
        plot.xLabel = "X Label"
        plot.yLabel = "Y Label"
        plot.yLimits = (0, 60)

        plot.grid.color = "#ff0000"
        plot.grid.style = "dotted"
        plot.grid.visible = True

        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:19,代码来源:test_customgrid.py

示例9: latency

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
def latency(output_graph_filename, csv_file_dir_list):
    """
    Plots three graphs side-by-side. First, redis performance; second, pkt-in
    latency; third, pkt-out latency.
    
    """
    layout = PlotLayout()
    redis_plot = Plot()
    pkt_in_plot = Plot()
    flow_mod_plot = Plot()

    redis_plot.yLabel = 'CDF'
    flow_mod_plot.hasLegend(location='lower right')
    flow_mod_plot.legendLabelSize = 12
        
    redis_plot.xLabel = '(a) Query completion time (ms)'
    pkt_in_plot.xLabel = '(b) Switch processing time for ingress (ms)'
    flow_mod_plot.xLabel = '(c) Switch processing time for egress (ms)'
    
    for csv_dir in csv_file_dir_list:
        
        color = colors.pop(0)
        line_style = line_styles.pop(0)
        line_label = csv_dir.split('/')[-2]
        attr_dict = {'color': color, 'label': capitalize(line_label), 
                     'yLimits': (0, 1), 'lineStyle': line_style}
        
        redis_line = get_line_from_csv(os.path.join(csv_dir, 'async_redis_latency.csv'), 
                                       xLimits=(0,400), **attr_dict) 
        pkt_in_line = get_line_from_csv(os.path.join(csv_dir, 'pkt_in_durations.csv'), 
                                        xLimits=(0,140), **attr_dict) 
        flow_mod_line = get_line_from_csv(os.path.join(csv_dir, 'flow_mod_durations.csv'), 
                                          xLimits=(0,140), **attr_dict)         
        redis_plot.add(redis_line)
        pkt_in_plot.add(pkt_in_line)
        flow_mod_plot.add(flow_mod_line)

    
    layout.addPlot(redis_plot)
    layout.addPlot(pkt_in_plot)
    layout.addPlot(flow_mod_plot)
    layout.width = 3
    layout.setPlotDimensions(4.5,4.5*0.618)
    
    layout.save('data/graphs/' + output_graph_filename + '.pdf')
    print 'Done.'
开发者ID:crazyideas21,项目名称:swclone,代码行数:48,代码来源:hotsdn_graphs.py

示例10: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        plot = Plot()

        line = Line()
        line.yValues = [25, 40, 30, 23, 10, 50]
        line.xValues = range(len(line.yValues))

        plot.add(line)
        plot.xLabel = "X Label"
        plot.yLabel = "Y Label"
        plot.yLimits = (0, 60)

        plot.xTickLabelSize = 24
        plot.yTickLabelSize = 36
        plot.axesLabelSize = 18
        plot.tight = True

        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:20,代码来源:test_fontsizes.py

示例11: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = [0, 1, 2, 3, 4, 5,
                        6, 7, 8, 9, 10]
        line.yValues = [0, 1, 4, 9, 16, 25,
                        36, 49, 64, 81, 100]

        plot = Plot()
        plot.useLatexLabels()
        plot.xLabel = r"$x$"
        plot.yLabel = r"$f(x) = x^2$"
        plot.title = (
            r"LaTeX is Number $\sum_{n=1}^{\infty}"
            r"\frac{-e^{i\pi}}{2^n}$")
        plot.add(line)
        plot.tight = True
        plot.axesLabelSize = 18
        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:20,代码来源:test_latex.py

示例12: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = numpy.arange(0, 150, 0.01)
        line.yValues = numpy.cos(.02 * numpy.pi * line.xValues)

        plot = Plot()
        plot.add(line)
        plot.xLimits = (0, 150)
        plot.yLimits = (-1, 1)
        plot.xLabel = "X"
        plot.yLabel = "cos(X)"
        splitPlots = plot.split(2)

        layout = PlotLayout()
        layout.width = 2
        layout.addPlot(plot, grouping="unsplit")

        for s in splitPlots:
            layout.addPlot(s, grouping="splits")

        layout.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:23,代码来源:test_split.py

示例13: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [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

示例14: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = numpy.arange(0.0, 5.0, 0.01)
        line.yValues = numpy.cos(2 * numpy.pi * line.xValues)

        maxLabel = Label(2, 1, "Maximum!")
        maxLabel.textOffset = (0.5, 0.5)
        maxLabel.hasArrow()

        minLabel = Label(1.5, -1, "Minimum!")
        minLabel.textPosition = (1, -2)
        minLabel.hasArrow()

        randomLabel = Label(2, -1.7, "A Point!")
        randomLabel.textOffset = (0, 0.2)
        randomLabel.marker = 'o'

        styledLabel = Label(1.25, 1.2, "A FancyPoint!",
                            bbox={'edgecolor':'red',
                                  'facecolor':'white',
                                  'ls':'dashed',
                                  'lw':'2'})
        styledLabel.textOffset = (0, 0.2)
        styledLabel.marker = 'o'

        plot = Plot()
        plot.add(line)
        plot.add(minLabel)
        plot.add(maxLabel)
        plot.add(randomLabel)
        plot.add(styledLabel)
        plot.yLimits = (-3, 3)
        plot.xLabel = "X"
        plot.yLabel = "cos(x)"
        plot.save("label.png")
        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:38,代码来源:test_label.py

示例15: time_of_trial

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLabel [as 别名]
    return trial_data


def time_of_trial(data):
    return (data[u"end_time"] - data[u"start_time"]) if u"success" in data else 1000000


def times_of_trials(trial_datas):
    return [time_of_trial(data) for data in trial_datas]


root_dir = sys.argv[1] if len(sys.argv) >= 2 else "results"

dirs = os.listdir(root_dir)
sort_nicely(dirs)
num_tests = len(dirs)
avg_test_times = [avg_time_for_test(os.path.join(root_dir, a_dir)) for a_dir in dirs]

plot = Plot()

x_vals = [int(a_dir.split("-")[0]) for a_dir in dirs]

line = Line()
line.yValues = avg_test_times
line.xValues = x_vals
plot.add(line)

plot.xLabel = "# Clients"
plot.yLabel = "Miliseconds"
plot.save("mega_graph.png")
开发者ID:snyderp,项目名称:drano-stress-tests,代码行数:32,代码来源:meta_graph.py


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