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


Python Plot.yLimits方法代码示例

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


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

示例1: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLimits [as 别名]
    def constructImage(self):
        bar1 = Bar()
        bar1.xValues = range(5)
        bar1.yValues = [1, 2, 1, 2, 3]
        bar1.color = "red"
        bar1.label = "Red Cluster"

        bar2 = Bar()
        bar2.xValues = range(5)
        bar2.yValues = [2, 2, 3, 3, 4]
        bar2.color = "blue"
        bar2.label = "Blue Cluster"

        bar3 = Bar()
        bar3.xValues = range(5)
        bar3.yValues = [3, 5, 4, 5, 3]
        bar3.color = "green"
        bar3.label = "Green Cluster"

        stackedBars = StackedBars()
        stackedBars.add(bar1)
        stackedBars.add(bar2)
        stackedBars.add(bar3)

        stackedBars.xTickLabels = ["A", "B", "C", "D", "E"]

        plot = Plot()
        plot.add(stackedBars)
        plot.yLimits = (0, 15)
        plot.hasLegend()
        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:33,代码来源:test_stackedbar.py

示例2: main

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

示例4: generatePlot

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLimits [as 别名]
        def generatePlot(stepType):
            line = Line()
            line.xValues = xVals
            line.yValues = yVals
            line.marker = 'o'
            line.stepFunction(stepType)

            plot = Plot()
            plot.add(line)
            plot.title = r'"%s" Steps' % (stepType)
            plot.xLimits = (0, 6)
            plot.yLimits = (0, 6)

            return plot
开发者ID:alexras,项目名称:boomslang,代码行数:16,代码来源:test_steps.py

示例5: constructImage

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

示例6: constructImage

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

示例7: constructImage

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

示例8: constructImage

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

示例9: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import yLimits [as 别名]
    def constructImage(self):
        line1 = Line()
        line2 = Line()
        line3 = Line()

        line1.xValues = range(0,10)
        line1.yValues = [2,5,2,3,2,2,1,0,1,0]
        line2.xValues = range(0,10)
        line2.yValues = [3,1,2,3,2,1,5,3,1,7]
        line3.xValues = range(0,10)
        line3.yValues = [2,1,3,1,3,4,1,4,5,0]

        stack = StackedLines()
        stack.addLine(line1, "red")
        stack.addLine(line2, "green")
        stack.addLine(line3, "blue")

        plot = Plot()
        plot.xLimits = (0, 9)
        plot.yLimits = (0, 7)
        plot.add(stack)
        plot.save(self.imageName)
开发者ID:alexras,项目名称:boomslang,代码行数:24,代码来源:test_stackedlines.py

示例10: constructImage

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


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