本文整理汇总了Python中reportlab.graphics.charts.lineplots.LinePlot.lineLabelFormat方法的典型用法代码示例。如果您正苦于以下问题:Python LinePlot.lineLabelFormat方法的具体用法?Python LinePlot.lineLabelFormat怎么用?Python LinePlot.lineLabelFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.graphics.charts.lineplots.LinePlot
的用法示例。
在下文中一共展示了LinePlot.lineLabelFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: line_plot
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
def line_plot(data, elements):
drawing = Drawing(0, 400) # for indices
lp = LinePlot()
lp.x = 0
lp.y = 50
lp.height = 300
lp.width = 600
lp.data = data
lp.joinedLines = 1
lp.lines[0].symbol = makeMarker('FilledCircle')
lp.lines[1].symbol = makeMarker('Circle')
lp.lineLabelFormat = '%2.0f'
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.valueSteps = [1, 2, 2.5, 3, 4, 5]
lp.xValueAxis.labelTextFormat = '%2.1f'
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 7
lp.yValueAxis.valueSteps = [1, 2, 3, 5, 6]
drawing.add(lp)
elements.append(drawing)
示例2: LinePlot
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
data = [
((1,1), (2,2), (2.5,1), (3,3), (4,5)),
((1,2), (2,3), (2.5,2), (3.5,5), (4,6))
]
lp = LinePlot()
lp.x = 50
lp.y = 50
lp.height = 125
lp.width = 300
lp.data = data
lp.joinedLines = 1
lp.lines[0].symbol = makeMarker('FilledCircle')
lp.lines[1].symbol = makeMarker('Circle')
lp.lineLabelFormat = '%2.0f'
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.valueSteps = [1, 2, 2.5, 3, 4, 5]
lp.xValueAxis.labelTextFormat = '%2.1f'
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 7
lp.yValueAxis.valueSteps = [1, 2, 3, 5, 6]
drawing.add(lp)
draw(drawing, 'LinePlot sample')
示例3: Drawing
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
from reportlab.graphics.widgets.markers import makeMarker
drawing = Drawing(400, 200)
data = [((1, 1), (2, 2), (2.5, 1), (3, 3), (4, 5)), ((1, 2), (2, 3), (2.5, 2), (3.5, 5), (4, 6))]
lp = LinePlot()
lp.x = 50
lp.y = 50
lp.height = 125
lp.width = 300
lp.data = data
lp.joinedLines = 1
lp.lines[0].symbol = makeMarker("FilledCircle")
lp.lines[1].symbol = makeMarker("Circle")
lp.lineLabelFormat = "%2.0f"
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.valueSteps = [1, 2, 2.5, 3, 4, 5]
lp.xValueAxis.labelTextFormat = "%2.1f"
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 7
lp.yValueAxis.valueSteps = [1, 2, 3, 5, 6]
drawing.add(lp)
draw(drawing, "LinePlot sample")
disc("")
示例4: generate_certificate
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
def generate_certificate(elements):
style = TableStyle([('TEXTALIGN', (0, 0), (-1, -1), 'CENTER'),
('TEXTCOLOR', (0, 0), (-1, -1), colors.red),
('VALIGN', (0, 0), (0, -1), 'TOP'),
('INNERGRID', (0, 0), (-1, -1), 0.50, colors.red),
('BOX', (0, 0), (-1, -1), 0.50, colors.green),
('BACKGROUND', (0, 0), (-1, -1), colors.blue),
])
s = getSampleStyleSheet()
s = s["BodyText"]
s.wordWrap = "RGB"
styles = ParagraphStyle(
name='Normal',
fontName='Helvetica-Bold',
fontSize=15,
alignment=1,
)
elements.append(Spacer(1, 0.5 * inch))
i = Paragraph(str("candidate performance vs average performance"), styles)
elements.append(i)
elements.append(Spacer(1, 0.1 * inch))
drawing = Drawing(0, 200) # for indices
data = [
(13, 5, 20, 22, 37, 45, 19, 4),
(14, 6, 21, 23, 38, 46, 20, 5)
] # data for drawing bar graphs
bc = VerticalBarChart()
bc.x = 0 # x,y define the left bottom of graph
bc.y = 0
bc.height = 150
bc.width = 300
bc.data = data
bc.strokeColor = colors.black
bc.valueAxis.valueMin = 0
bc.valueAxis.valueMax = 50
bc.valueAxis.valueStep = 10
bc.categoryAxis.labels.boxAnchor = 'ne'
bc.categoryAxis.labels.dx = 6 # next 3 lines is for naming indices
bc.categoryAxis.labels.dy = -2
bc.categoryAxis.labels.angle = 60
bc.categoryAxis.categoryNames = ['Jan-99', 'Feb-99', 'Mar-99',
'Apr-99', 'May-99', 'Jun-99', 'Jul-99', 'Aug-99']
drawing.add(bc)
elements.append(drawing)
elements.append(Spacer(1, 0.5 * inch))
drawing = Drawing(0, 175) # for indices
lc = HorizontalLineChart()
lc.x = 0
lc.y = 10
lc.height = 150
lc.width = 300
lc.data = data
lc.joinedLines = 1
catNames = 'Jan Feb Mar Apr May Jun Jul Aug'.split(' ')
lc.categoryAxis.categoryNames = catNames
lc.categoryAxis.labels.boxAnchor = 'n'
lc.valueAxis.valueMin = 0
lc.valueAxis.valueMax = 60
lc.valueAxis.valueStep = 15
lc.lines[0].strokeWidth = 2
lc.lines[1].strokeWidth = 1.5
drawing.add(lc)
elements.append(drawing)
drawing = Drawing(0, 400) # for indices
data = [
((1, 1), (2, 2), (2.5, 1), (3, 3), (4, 5)),
((1, 2), (2, 3), (2.5, 2), (3.5, 5), (4, 6))
]
elements.append(Spacer(1, 0.1 * inch))
i = Paragraph(str("candidate performance vs average performance"), styles)
elements.append(i)
elements.append(Spacer(1, 0.1 * inch))
lp = LinePlot()
lp.x = 0
lp.y = 50
lp.height = 300
lp.width = 600
lp.data = data
lp.joinedLines = 1
lp.lines[0].symbol = makeMarker('FilledCircle')
lp.lines[1].symbol = makeMarker('Circle')
lp.lineLabelFormat = '%2.0f'
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.valueSteps = [1, 2, 2.5, 3, 4, 5]
lp.xValueAxis.labelTextFormat = '%2.1f'
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 7
lp.yValueAxis.valueSteps = [1, 2, 3, 5, 6]
drawing.add(lp)
elements.append(drawing)
elements.append(Spacer(1, 0.1 * inch))
drawing = Drawing(100, 350)
pc = Pie()
pc.x = 65
pc.y = 15
pc.width = 300
pc.height = 300
pc.data = [10, 20, 30, 40, 50, 60]
#.........这里部分代码省略.........
示例5: round
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
fp_sum = fp_sum + dat_dict[num_clust][str(i)]['ALL_COUNT']/float(TOT)
fn_sum = fn_sum + dat_dict[num_clust][str(i)]['AML_COUNT']/float(TOT)
FP = TP - fp_sum
FN = TN - fn_sum
accuracy = (TP + TN) / (TP + FP + TN + FN) * 100.00
accuracy_list.append((num_clust, accuracy))
print "| %d | %02.2f | %02.2f | %02.2f | %02.2f | %02.2f |" % (num_clust, round(fp_sum), round(FP), round(fn_sum), round(FN), round(accuracy))
print "+---------------|-------|------|------|------|--------+"
lp.data = [accuracy_list]
print lp.data
lp.joinedLines = 1
lp.lines.symbol = makeMarker('Circle')
lp.lineLabelFormat = '%2.2f'
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.labelTextFormat = '%2.0f'
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 104
lp.yValueAxis.valueStep = 10
xlbl = Label()
xlbl.setText("No. of Clusters")
xlbl.setOrigin(310, 53)
xlbl1 = Label()
xlbl1.setText("No. Of Clusters Vs Accuracy")
xlbl1.setOrigin(310, 25)
开发者ID:oommenkm,项目名称:K-Modes-Algorithm-as-a-tool-for-leukemia-microarray-data-Clustering,代码行数:33,代码来源:plot_accuracy_vs_numOfClusters_1_0.py
示例6: generate_certificate
# 需要导入模块: from reportlab.graphics.charts.lineplots import LinePlot [as 别名]
# 或者: from reportlab.graphics.charts.lineplots.LinePlot import lineLabelFormat [as 别名]
def generate_certificate(elements):
styles = ParagraphStyle(
name='Normal',
fontName='Helvetica-Bold',
fontSize=15,
alignment=1,
)
elements.append(Spacer(1, 0.5 * inch))
i = Paragraph(str("candidate performance vs average performance"), styles)
elements.append(i)
elements.append(Spacer(1, 0.1 * inch))
drawing = Drawing(0, 200) # for indices
data = [
(13, 5, 20, 22, 37, 45, 19, 4),
(14, 6, 21, 23, 38, 46, 20, 5)
] # data for drawing bar graphs
bc = VerticalBarChart()
bc.x = 0 # x,y define the left bottom of graph
bc.y = 0
bc.height = 150
bc.width = 300
bc.data = data
bc.strokeColor = colors.black
bc.valueAxis.valueMin = 0
bc.valueAxis.valueMax = 50
bc.valueAxis.valueStep = 10
bc.categoryAxis.labels.boxAnchor = 'ne'
bc.categoryAxis.labels.dx = 6 # next 3 lines is for naming indices
bc.categoryAxis.labels.dy = -2
bc.categoryAxis.labels.angle = 60
bc.categoryAxis.categoryNames = ['Jan-99', 'Feb-99', 'Mar-99',
'Apr-99', 'May-99', 'Jun-99', 'Jul-99', 'Aug-99']
drawing.add(bc)
elements.append(drawing)
elements.append(Spacer(1, 0.5 * inch))
drawing = Drawing(0, 175) # for indices
lc = HorizontalLineChart()
lc.x = 0
lc.y = 10
lc.height = 150
lc.width = 300
lc.data = data
lc.joinedLines = 1
catnames = 'Jan Feb Mar Apr May Jun Jul Aug'.split(' ')
lc.categoryAxis.categoryNames = catnames
lc.categoryAxis.labels.boxAnchor = 'n'
lc.valueAxis.valueMin = 0
lc.valueAxis.valueMax = 60
lc.valueAxis.valueStep = 15
lc.lines[0].strokeWidth = 2
lc.lines[1].strokeWidth = 1.5
drawing.add(lc)
elements.append(drawing)
drawing = Drawing(0, 400) # for indices
data = [
((1, 1), (2, 2), (2.5, 1), (3, 3), (4, 5)),
((1, 2), (2, 3), (2.5, 2), (3.5, 5), (4, 6))
]
elements.append(Spacer(1, 0.1 * inch))
i = Paragraph(str("candidate performance vs average performance"), styles)
elements.append(i)
elements.append(Spacer(1, 0.1 * inch))
lp = LinePlot()
lp.x = 0
lp.y = 50
lp.height = 300
lp.width = 600
lp.data = data
lp.joinedLines = 1
lp.lines[0].symbol = makeMarker('FilledCircle')
lp.lines[1].symbol = makeMarker('Circle')
lp.lineLabelFormat = '%2.0f'
lp.strokeColor = colors.black
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueMax = 5
lp.xValueAxis.valueSteps = [1, 2, 2.5, 3, 4, 5]
lp.xValueAxis.labelTextFormat = '%2.1f'
lp.yValueAxis.valueMin = 0
lp.yValueAxis.valueMax = 7
lp.yValueAxis.valueSteps = [1, 2, 3, 5, 6]
drawing.add(lp)
elements.append(drawing)
elements.append(Spacer(1, 0.1 * inch))
drawing = Drawing(100, 350)
pc = Pie()
pc.x = 65
pc.y = 15
pc.width = 300
pc.height = 300
pc.data = [10, 20, 30, 40, 50, 60]
pc.labels = ['a', 'b', 'c', 'd', 'e', 'f']
pc.slices.strokeWidth = 0.5
pc.slices[3].popout = 10
pc.slices[3].strokeWidth = 2
pc.slices[3].strokeDashArray = [2, 2]
pc.slices[3].labelRadius = 1.75
pc.slices[3].fontColor = colors.red
drawing.add(pc)
elements.append(drawing)
elements.append(Spacer(1, 0.7 * inch))
#.........这里部分代码省略.........