Python 2.7 如何在ReportLab线型图中标记单位?

Python 2.7 如何在ReportLab线型图中标记单位?,python-2.7,reportlab,line-plot,Python 2.7,Reportlab,Line Plot,有人能告诉我在ReportLab中为线图上的单位设置标签的属性吗?此外,如果你知道如何设置标题,那最终会非常有用 drawing = Drawing(50,50) data = [(tuple(zip(matfile['chan'].item([6],matfile['chan'].item()[7].item()[0])))] lp = LinePlot() lp.data = data lp.????? = (str(matfile['chan'].item()[3]), str(matfi

有人能告诉我在ReportLab中为线图上的单位设置标签的属性吗?此外,如果你知道如何设置标题,那最终会非常有用

drawing = Drawing(50,50)
data = [(tuple(zip(matfile['chan'].item([6],matfile['chan'].item()[7].item()[0])))]
lp = LinePlot()
lp.data = data
lp.????? = (str(matfile['chan'].item()[3]), str(matfile['chan'].item()[2]))
drawing.add(lp)
elements.append(drawing)

这实际上是在一个循环中-我加载一个.mat文件,大约有50个通道,我将绘制几乎所有的通道。分别地但首先我需要得到一个分配标签的句柄(标题文本,它将与通道相同,然后轴的单位…)X轴标签应始终为“秒”,Y轴标签将变化。。。有时是a%,有时是压力、温度或速度等。

我不知道怎么做,但我最终使用了框架表,并拼凑了一些东西。我没有成功地旋转y轴标签的文本

for channel in channels:
    drawing = Drawing(0,0)
    data = [(tuple(zip(matfile[channel].item()[6],matfile[channel].item()[7].item()[0])))]
    lp = LinePlot()
    lp.data = data
    lp.width = 6*inch
    lp.height = 3.25*inch

    stylesheet = getSampleStyleSheet()
    y_label = Paragraph(str(matfile[channel].item()[2]), stylesheet['Normal'])

    drawing.add(lp)
    plot_table = [['',str(channel)],
                  [y_label, drawing],
                  ['',matfile[channel].item()[3]]]

    t_framing_table = Table(plot_table)
    t_framing_table._argH[1] = lp.height + .5*inch
    t_framing_table._argW[1] = lp.width


    elements.append(t_framing_table)
    if  break_page:
        elements.append(PageBreak())
        break_page = False
    else:
        break_page = True

我不知道怎么做,但我最终使用了框架表,我拼凑了一些东西。我没有成功地旋转y轴标签的文本

for channel in channels:
    drawing = Drawing(0,0)
    data = [(tuple(zip(matfile[channel].item()[6],matfile[channel].item()[7].item()[0])))]
    lp = LinePlot()
    lp.data = data
    lp.width = 6*inch
    lp.height = 3.25*inch

    stylesheet = getSampleStyleSheet()
    y_label = Paragraph(str(matfile[channel].item()[2]), stylesheet['Normal'])

    drawing.add(lp)
    plot_table = [['',str(channel)],
                  [y_label, drawing],
                  ['',matfile[channel].item()[3]]]

    t_framing_table = Table(plot_table)
    t_framing_table._argH[1] = lp.height + .5*inch
    t_framing_table._argW[1] = lp.width


    elements.append(t_framing_table)
    if  break_page:
        elements.append(PageBreak())
        break_page = False
    else:
        break_page = True

可能派对迟到了,但我刚刚发现了这篇文章,它描述了如何在表中旋转字符串。可能派对迟到了,但我刚刚发现了这篇文章,它描述了如何在表中旋转字符串。