【发布时间】:2016-12-07 16:31:08
【问题描述】:
过去一周我一直在使用 Bokeh,但我似乎无法做一件事。
这是我的脚本的一部分:
data5 = dict(depth = df4['Depth'], length = df4['Length'], recovery = df4['Recovery'], peak = df4['Peak'], valley = df4['Valley'], exitdate = df4['Exit Date'])
data6 = dict(returns = df5['Return'], correlation = df5['Correlation'])
source5 = ColumnDataSource(data5)
source6 = ColumnDataSource(data6)
columns5 = [TableColumn(field = 'depth', title = 'Depth'), TableColumn(field = 'length', title = 'Length (Months)'),
TableColumn(field = 'recovery', title = 'Recovery (Months)'), TableColumn(field = 'peak', title = 'Peak'),
TableColumn(field = 'valley', title = 'Valley'), TableColumn(field = 'exitdate', title = 'Exit Date')]
columns6 = [TableColumn(field = 'returns', title = 'Return'), TableColumn(field = 'correlation', title = 'Correlation')]
table5 = DataTable(source = source5, columns = columns5, width = 700, height = 350, editable = False)
table6 = DataTable(source = source6, columns = columns6, width = 400, height = 300, editable = False)
para5 = Paragraph(text = 'Portfolio', height = 1)
para6 = Paragraph(text = 'Benchmark', height = 1)
title2 = Paragraph(text = 'Drawdown Review (Since Sep 2011)', height = 1)
t2 = vplot(vform(para5), vform(table5))
t3 = vplot(vform(para6), vform(table6))
t4 = hplot(t2, t3)
q5 = vplot(vform(title2), t4)
tab0 = Panel(child = q0, title = 'Rolling Statistics')
tab1 = Panel(child = q1, title = 'Up-Down Capture')
tab2 = Panel(child = q2, title = 'Historical Statistics')
tab3 = Panel(child = q3, title = 'Historical Track Record')
tab4 = Panel(child = q4, title = 'Historical Analysis')
tab5 = Panel(child = q5, title = 'Drawdown Review')
tabs = Tabs(tabs = [tab3, tab4, tab5, tab0 ,tab1, tab2])
bk.io.show(tabs)
我意识到没有办法(有吗?)为整个网格图的散景中的页面/选项卡设置标题。所以我插入了段落(para5/para6)。这很好用,除了文本是 Times New Roman 并且我希望它是另一种字体,比如 Arial,并且它是粗体和下划线。
我尝试了title2.text_font_style = 'arial' 之类的方法,但没有奏效。
According to the documentation,段落没有这种属性。
是否有一种迂回的方式来设置段落小部件的字体?
提前致谢
【问题讨论】: