在使用全息视图和Bokeh时,我一直在尝试设置一个标题。我把三个图叠加在一起。代码如下:
%%opts Curve [width=900 height=400 show_grid=True tools=['hover'] finalize_hooks=[apply_formatter]]
%%opts Curve (color=Cycle('Category20'))
%%opts Overlay [ legend_position='bottom' ] Curve (muted_alpha=0.5 muted_color='black' )
actual_curve = hv.Curve(df_reg_test, 'date', 'y', label='Actual')
existing_curve = hv.Curve(df_reg_test, 'date', 'Forecast Calls', label='Existing Forecast')
xgb_curve = hv.Curve(df_reg_test, 'date', 'xgb_pred', label='New Forecast')
actual_curve * existing_curve * xgb_curve
如你所见,单个曲线的标签在图例中显示得很好,但我在图的顶部没有标题。在
如何手动设置标题?在
我发现可以在覆盖选项中添加title_format=“my new title”选项:
现在我的情节有了一个标题:
另一种向套印格式添加通用标题的方法是使用:
选择覆盖(title='New title for Overlay')
下面是一个在全息图覆盖图上设置标题的示例:
结果图如下:
相关问题 更多 >
编程相关推荐