本文整理汇总了Python中boomslang.Plot.setYLimits方法的典型用法代码示例。如果您正苦于以下问题:Python Plot.setYLimits方法的具体用法?Python Plot.setYLimits怎么用?Python Plot.setYLimits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boomslang.Plot
的用法示例。
在下文中一共展示了Plot.setYLimits方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setYLimits(0, 15)
plot.hasLegend()
plot.save(self.imageName)
示例2: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.setYLimits(0, 60)
plot.save(self.imageName)
示例3: generatePlot
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
def generatePlot(stepType):
line = Line()
line.xValues = xVals
line.yValues = yVals
line.marker = 'o'
line.stepFunction(stepType)
plot = Plot()
plot.add(line)
plot.setTitle(r'"%s" Steps' % (stepType))
plot.setXLimits(0, 6)
plot.setYLimits(0, 6)
return plot
示例4: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setTitle("Craaazy Title")
plot.setTitleProperties(style="italic", weight="bold", rotation="5",
color="orange")
plot.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.setYLimits(0, 60)
plot.setPlotParameters(bottom=.15, left=0.15)
plot.save(self.imageName)
示例5: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.setYLimits(0, 60)
plot.grid.color = "#ff0000"
plot.grid.style = "dotted"
plot.grid.visible = True
plot.save(self.imageName)
示例6: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.setYLimits(0, 60)
plot.setXTickLabelSize(24)
plot.setYTickLabelSize(36)
plot.setAxesLabelSize(18)
plot.setPlotParameters(bottom=0.14)
plot.save(self.imageName)
示例7: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setXLimits(0, 150)
plot.setYLimits(-1, 1)
plot.setXLabel("X")
plot.setYLabel("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)
示例8: constructImage
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [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.setYLimits(0, 7)
plot.setXLimits(0, 9)
plot.add(stack)
plot.save(self.imageName)
示例9: Bar
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
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.setYLimits(0, 15)
plot.hasLegend()
plot.save("stackedbar.png")
示例10: Plot
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
#!/usr/bin/env python
from boomslang import Line, Plot
plot = Plot()
line = Line()
line.yValues = [25, 40, 30, 23, 10, 50]
line.xValues = range(len(line.yValues))
plot.add(line)
plot.setXLabel("X Label")
plot.setYLabel("Y Label")
plot.setYLimits(0, 60)
plot.save("simpleline.png")
示例11: Line
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
#!/usr/bin/env python
from boomslang import Label, Line, Plot
import numpy
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.setTextOffset(0.5, 0.5)
maxLabel.hasArrow()
minLabel = Label(1.5, -1, "Minimum!")
minLabel.setTextPosition(1, -2)
minLabel.hasArrow()
randomLabel = Label(2, -1.7, "A Point!")
randomLabel.setTextOffset(0, 0.2)
randomLabel.marker = 'o'
plot = Plot()
plot.add(line)
plot.add(minLabel)
plot.add(maxLabel)
plot.add(randomLabel)
plot.setYLimits(-3, 3)
plot.setXLabel("X")
plot.setYLabel("cos(x)")
plot.save("label.png")
示例12: Line
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
#!/usr/bin/env python
from boomslang import Plot, Line, PlotLayout
import numpy
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.setXLimits(0, 150)
plot.setYLimits(-1, 1)
plot.setXLabel("X")
plot.setYLabel("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("split.png")
示例13: plot_timeline_for_phase
# 需要导入模块: from boomslang import Plot [as 别名]
# 或者: from boomslang.Plot import setYLimits [as 别名]
def plot_timeline_for_phase(log_directory, job, phase, phase_data):
min_timestamp = phase_data["min_timestamp"]
max_timestamp = phase_data["max_timestamp"]
description = Description(os.path.join(log_directory, job, "description"))
stage_ordering = description.getStageOrdering(phase)
duration_lists = {}
for stage in stage_ordering:
duration_lists[stage] = []
for key in phase_data:
if key in ["min_timestamp", "max_timestamp"]:
continue
hostname, stage, worker_id = key
worker_duration_info = Duration(
hostname.split('.')[0], stage, worker_id,
(phase_data[key][0] - min_timestamp) / 1000000.0,
(phase_data[key][1] - min_timestamp) / 1000000.0)
duration_lists[stage].append(worker_duration_info)
def sort_function(x):
return (x.hostname, x.worker_id, x.start_time, x.stop_time)
layout = PlotLayout()
for stage in stage_ordering:
duration_list = duration_lists[stage]
duration_list.sort(key=sort_function)
bars = {}
# Set up a "padding" bar that will appear to move bars up so that they
# start when the worker starts
start_bar = Bar()
start_bar.linewidth = 0
start_bar.color = "white"
for i, duration in enumerate(duration_list):
if duration.hostname not in bars:
bars[duration.hostname] = Bar()
bars[duration.hostname].yValues.append(
duration.stop_time - duration.start_time)
start_bar.yValues.append(duration.start_time)
# Make sure that all bars have the same number of y-axis values,
# give them x-axis values and set their colors
start_bar.xValues = range(len(start_bar.yValues))
start_bar.xTickLabelProperties = {
"rotation" : 90
}
bar_colors = ["red", "blue", "green", "orange", "gray", "pink",
"purple", "black"]
offset = 0
for i, (hostname, bar) in enumerate(bars.items()):
# Pad y axis with zeroes so that bars can be laid out next to
# each other with a StackedBars
num_y_values = len(bar.yValues)
bar.yValues = (([0] * offset) + bar.yValues +
([0] *
(len(duration_list) - (num_y_values + offset))))
# Put the label for this hostname roughly in the middle of its bar
# cluster
start_bar.xTickLabels.append(hostname)
# Subtracting 0.5 to account for half the width of the bar
start_bar.xTickLabelPoints.append(offset + (num_y_values / 2.0)
- 0.5)
offset += num_y_values
bar.xValues = range(len(bar.yValues))
bar.color = bar_colors[i % len(bar_colors)]
bar.label = hostname
stacked_bars = StackedBars()
stacked_bars.add(start_bar)
for hostname in sorted(bars.keys()):
stacked_bars.add(bars[hostname])
plot = Plot()
plot.setYLimits(0, ((max_timestamp - min_timestamp) / 1000000.0) * 1.05)
plot.setXLabel("Worker")
plot.setYLabel("Time (s)")
plot.setTitle(stage)
plot.add(stacked_bars)
layout.addPlot(plot)
#.........这里部分代码省略.........