小编SRL*_*SRL的帖子

如何绘制彼此相邻的绘图仪表图?

似乎 plotly 仪表图不兼容,subplot因为我最终得到了两个相互重叠的仪表图。

library(plotly)

fig1 <- plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 270,
  title = list(text = "Speed"),
  type = "indicator",
  mode = "gauge+number") 
fig1 <- fig1 %>%
  layout(margin = list(l=20,r=30))

fig1

fig2 <- plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 50,
  title = list(text = "Speed"),
  type = "indicator",
  mode = "gauge+number") 
fig2 <- fig2 %>%
  layout(margin = list(l=20,r=30))

fig2

fig <- subplot(fig1,fig2)
fig
Run Code Online (Sandbox Code Playgroud)

r gauge subplot plotly flexdashboard

5
推荐指数
1
解决办法
1164
查看次数

标签 统计

flexdashboard ×1

gauge ×1

plotly ×1

r ×1

subplot ×1