【发布时间】:2021-05-10 07:14:15
【问题描述】:
我正在尝试组合两个情节图(type = 'mesh3d' 和 type = 'scatter3d')。每个单独的地块都非常好,没有任何警告。在我使用subplot 后,每次尝试显示绘图时都会出现警告。
警告“布局”对象没有这些属性:“NA”
我试过suppressWarning,但这没有任何效果。
任何想法我在这里缺少什么来摆脱警告?
剧情版本:4.9.3 R 版本:4.0.1
# plot data
plt_data <- data.frame(maturity=rep(1:10, each=10),
tenor=rep(1:10, 10),
value=rnorm(100))
# plot 1
fig11 <- plot_ly(
data=plt_data, x=~maturity, y=~tenor, z = ~value,
type = "mesh3d",intensity = ~value,
colors = colorRamp(c(
rgb(168, 191, 173, max = 255),
rgb(100, 181, 117, max = 255),
rgb(0,100,80, max = 255)
)),
contour=list(show=T, width=4, color="#fff"),
showscale = F,
scene='scene1',
lighting = list(ambient = 0.9),
hoverinfo="skip",
source="myID"
)
# plot 2
fig12 <- plot_ly(
data=plt_data, x=~maturity, y=~tenor, z = ~value,
type = "scatter3d",
mode="markers",
hovertemplate="Maturity: %{x:.f}<br>Tenor: %{y:.f}<br>Value: %{z:.4f}<extra></extra>",
marker=list(
symbol="square-open",
size=4,
color="#3d543f"
),
scene='scene1',
source="myID",showlegend=F
)
# subplot which does throw a warning
subplot(fig11, fig12)
【问题讨论】:
标签: r plotly warnings r-plotly