我想知道如何消除Julia数组(1D)中的任何元素,如下所示.它是通过阅读文本文件而构建的,其中没有相关信息的行与具有相关信息的行混合在一起."没有"是类型Void,我想清理所有的数组.
nothing
nothing
nothing
nothing
nothing
" -16.3651\t 0.1678\t -4.6997\t -14.0152\t -2.6855\t -16.0294\t -7.8049\t -27.1912\t -5.0354\t -14.5187\t\r\n"
" -16.4490\t -1.0910\t -3.6087\t -12.6724\t -1.5945\t -14.7705\t -7.2174\t -25.2609\t -3.7766\t -14.3509\t\r\n"
" -16.4490\t -2.2659\t -2.4338\t -10.9100\t -0.5875\t -13.6795\t -6.7139\t -22.9950\t -2.9373\t -14.0991\t\r\n"
Run Code Online (Sandbox Code Playgroud) 我已经用 plotly 构建了一个表面图,我正在尝试根据我自己的文本来设置 hoverinfo。奇怪的是它不再起作用了。
library(plotly)
x <- rnorm(10)
y <- rnorm(10)
z <- outer(y, x)
p <- plot_ly(x = ~x, y = ~y, z = ~z, type = "surface",
text = ~paste0("My X = ", x, "\n My Y = ", y, "\n My Z = ", z),
hoverinfo = "text") %>% layout(dragmode = "turntable")
print(p)
Run Code Online (Sandbox Code Playgroud)
虽然
p <- plot_ly(x = ~x, y = ~y, z = ~z, type = "surface") %>% layout(dragmode = "turntable")
Run Code Online (Sandbox Code Playgroud)
效果很好。
我也试过用\nby代替<br …