gpt4 book ai didi

javascript - 在 jupyter 笔记本中使用 R 的 Leaflet.minichart

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:08 25 4
gpt4 key购买 nike

背景

我不熟悉Javascript语言,然后我在Jupyter笔记本中尝试了使用R的leaflet.minicart包。

编写示例代码如下:

library(leaflet)

m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
m # Print the map

但是,输出单元格无法很好地表示。可能下图不是很清楚,输出的图固定在一个窄条上。

enter image description here

同时,我在浏览器中打开保存的html文件(上传here),背景图无法显示。

enter image description here

最佳答案

我无法重现您的第一个问题, map 在我的 RStudio 查看器中显示正常。对于灰色 html 背景,它的答案在这里:

[https://gis.stackexchange.com/questions/187926/leaflet-output-is-grey][1]

用途:

library(leaflet);library(htmlwidgets)

m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")%>% addProviderTiles(providers$OpenStreetMap)
saveWidget(m, file="m.html")

关于javascript - 在 jupyter 笔记本中使用 R 的 Leaflet.minichart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48238501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com