2 回答

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超2個(gè)贊
另一種為疊加添加一般標(biāo)題的方法是使用:
opts.Overlay(title='New title for Overlay')
以下是在 Holoview 疊加圖上設(shè)置標(biāo)題的示例:
# import libraries
import numpy as np
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')
# create some sample data
data1 = np.random.normal(size=[50, 2])
data2 = np.random.normal(size=[50, 2])
# create your overlay plot
all_plots = hv.Scatter(data1, label='data1') * hv.Scatter(data2, label='data2')
# add your title to your overlay with opts.Overlay()
all_plots.opts(opts.Overlay(title='New title for Overlay'))
結(jié)果圖將如下所示:

TA貢獻(xiàn)2039條經(jīng)驗(yàn) 獲得超8個(gè)贊
我發(fā)現(xiàn)我可以在疊加選項(xiàng)中添加一個(gè) title_format="my new title" 選項(xiàng):
%%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' title_format="my new title"] 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
現(xiàn)在我的情節(jié)有一個(gè)標(biāo)題:
添加回答
舉報(bào)