plot - Plotly R sankey plot - 在单个悬停标签上隐藏值
问题描述
我在 r (plot_ly) 中使用 plotly 创建了一个非常标准的 sankey 图。有没有办法在悬停标签中只显示一些值。我想显示所有链接,但由于数据机密性限制,隐藏其中少数的特定值。
谢谢
fig <- plot_ly(
type = "sankey",
domain = list(x = c(0,1),y = c(0,1)),
arrangement = "freeform",
orientation = "h",
valueformat = ".1f",
#valuesuffix = "TWh",key
node = list(
label = lab,
x=posx,
y=posy,
color = col,
pad = 10,
thickness = 15,
line = list(color = "black",width = 0.5)
),
link = list(
source = sum$source,
target = sum$target,
value = sum$value,
label = sum$label,
color = sum$color
)
)
fig <- fig %>% layout(
#title = "", font = list(size = 10),
xaxis = list(showgrid = F, zeroline = F),
yaxis = list(showgrid = F, zeroline = F)
)
fig
解决方案
推荐阅读
- python - 如何将形状为 (25000, 256,256,3) 的 python 数组转换为 (25000,3,256,256,3) ,其中 3 个图像完全相同?
- python - 使用名称的变量访问列表或字典
- c - I2C CCS 多读 MSP430g2553
- for-loop - 仅一次迭代后,Google 应用程序脚本就停止了
- gcc - 构建 GCC-Ada,使用非常旧的 gnatmake 编译 s-excmac.adb 时出现语法错误
- webpack - webpack 说 WorkboxWebpackPlugin.InjectManifest 不是构造函数
- python - Python 的总和不返回与 NumPy 的 numpy.sum 相同的结果
- android - 带有 nodejs+expressjs 的 PWA(渐进式 Web 应用程序)在启动时指向 /public/ 文件夹。怎么修?
- ssl - 如何为 java 客户端创建具有特定网站证书的密钥库?
- java - 通过 selenium 在 headless chrome webdriver 下解决 google 的 recaptcha 的方法?爪哇