【发布时间】:2020-09-24 07:48:53
【问题描述】:
您好,我如何将多个项目粘贴到一个情节标题中。这是我的代码:
timestep = 2
lst_raitings_hy = c("BB", "B")
fig_hy <- plot_ly(x = summaries_hy$maturity)
fig_hy <- fig_hy %>% add_trace(y = summaries_hy$mean_yield, name = "Mean", type="scatter", mode="lines+markers", marker=list(color = "rgba(0,100,0,1)", line = list(color = "rgba(0,100,0,1)", shape = "spline")))
fig_hy <- fig_hy %>% add_trace(y = summaries_hy$perc_005, name = "0.5% Percentile", type="scatter", fill='tonexty', fillcolor='rgba(0,70,100,0.5)',mode = 'lines', line = list(color = "transparent", shape = "spline"))
fig_hy <- fig_hy %>% add_trace(y = summaries_hy$perc_05, name = "5% Percentile", type="scatter", fill='tonexty', fillcolor='rgba(0,50,100,0.6)', mode = 'lines', line = list(color = "transparent", shape = "spline"))
fig_hy <- fig_hy %>% add_trace(y = summaries_hy$perc_75, name = "75% Percentile", type="scatter", fill='tonexty', fillcolor='rgba(0,40,100,0.4)', mode = 'lines', line = list(color = "transparent", shape = "spline"))
fig_hy <- fig_hy %>% add_trace(y = summaries_hy$perc_995, name = "99.5% Percentile", type="scatter", fill='tonexty', fillcolor='rgba(0,10,100,0.1)', mode = 'lines', line = list(color = "transparent", shape = "spline"))
fig_hy <- fig_hy %>% layout(
title = paste("Worst Case HighYield SpotSpread Curve timestep", timestep, lst_raitings_hy),
xaxis = list(title = "Maturity"),
yaxis = list(title = "Spot Spread", tickformat=" .2%")
)
fig_hy
现在你可以看到我想在标题中粘贴两个 raiting,但它不起作用。如果我只选择一个,一切都很好。 谢谢!:)
【问题讨论】: