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


Python Plot.title方法代码示例

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


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

示例1: constructImage

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import title [as 别名]
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2,3,5,7,9]
        line.label = "A Line"

        linePlot1 = Plot()
        linePlot1.title = "Small Legend"
        linePlot1.add(line)
        linePlot1.hasLegend()
        linePlot1.legendLabelSize = 10

        linePlot2 = Plot()
        linePlot2.title = "Large Legend"
        linePlot2.add(line)
        linePlot2.hasLegend()
        linePlot2.legendLabelSize = 30

        linePlot3 = Plot()
        linePlot3.title = "Inherited from Layout"
        linePlot3.add(line)
        linePlot3.hasLegend()

        layout = PlotLayout()
        layout.width = 2
        layout.addPlot(linePlot1)
        layout.addPlot(linePlot2)
        layout.addPlot(linePlot3)
        layout.legendLabelSize = 15

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

示例2: constructImage

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

示例3: constructImage

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

        for i in xrange(3):
            line = Line()
            line.xValues = xrange(5)
            line.yValues = [(i+1 / 2.0) *  pow(x, i+1) for x in line.xValues]
            line.label = "Line %d" % (i + 1)
            lines.append(line)

        plot = Plot()
        plot.add(lines[0])

        inset = Plot()
        inset.add(lines[1])
        inset.hideTickLabels()
        inset.title = ("Inset in Yo Inset\nSo You Can Inset\nWhile You Inset")

        insideInset = Plot()
        insideInset.hideTickLabels()
        insideInset.add(lines[2])

        inset.addInset(insideInset, width=0.4, height=0.3,
                       location="upper left")

        plot.addInset(inset, width=0.4, height=0.4, location="lower right")

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

示例4: constructImage

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

示例5: generatePlot

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

示例6: constructImage

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

示例7: constructImage

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

示例8: Scatter

# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import title [as 别名]
    j = j + 1




### Plotting
scatter = Scatter()
scatter.xValues = x
scatter.yValues = surf
scatter.markerSize = 1

scatterPlot = Plot()
scatterPlot.add(scatter)
scatterPlot.xLabel = "X Data"
scatterPlot.yLabel = "Height"
scatterPlot.title = "Surface (raw)"

layout = PlotLayout()
layout.addPlot(scatterPlot)
#layout.plot()
layout.save("profile1.png")

# now plot the gradient
scatter.yValues = surfGradient
scatterPlot.yLabel = "dHeight/dX"
scatterPlot.title = "Surface - Gradient"

layout = PlotLayout()
layout.addPlot(scatterPlot)
#layout.plot()
layout.save("profile1_gradient.png")
开发者ID:rayjanwilson,项目名称:roadmapper,代码行数:33,代码来源:scratch.py


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