0

我正在尝试通过 R 中的串扰连接一个绘图图和一个绘图图。我知道如何控制每个图的宽度,如下所示:

bscols(widths = c(6, 6),
 graph, map)

但我得到了一半的输出。如何控制高度?我想要全尺寸的图表和地图:从屏幕的顶部到底部。目前,我将屏幕的上半部分分成两个相等的宽度(6,6)。事实上,我有与本书中介绍的相同的东西:

https://plotly-r.com/client-side-linking.html#filter - 第 16.2 章,图 16.9:

图表在这里: https ://plotly-r.com/interactives/plotly-leaflet-filter.html

代码:

library(leaflet)
library(quakes)

eqs <- highlight_key(quakes)

stations <- filter_slider("station", "Number of Stations", eqs, ~stations)

p <- plot_ly(eqs, x = ~depth, y = ~mag) %>% add_markers(alpha = 0.5) %>% highlight("plotly_selected")

map <- leaflet(eqs) %>%  addTiles() %>% addCircles()

bscols(
widths = c(6, 6, 3), 
 p, map, stations)
4

0 回答 0