【发布时间】:2018-10-17 07:12:37
【问题描述】:
我可以像这个例子一样在地图上绘制圆形标记。但是我想在 add_markers 中将标记形状从圆形更改为正方形,但是在帮助(add_markers)或在线示例中找不到解决方案。我试图添加 type=list("squares") 但不幸的是它没有改变任何东西。
require(plotly)
df<- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_ebola.csv')
# restrict from June to September
df <- subset(df, Month %in% 6:9)
# ordered factor variable with month abbreviations
df$abbrev <- ordered(month.abb[df$Month], levels = month.abb[6:9])
# September totals
df9 <- subset(df, Month == 9)
p <- df %>%
plot_geo(
locationmode = 'country names', sizes = c(1, 600), color = I("black")
) %>%
add_markers(
y = ~Lat, x = ~Lon, locations = ~Country,
size = ~Value, color = ~abbrev, text = ~paste(Value, "cases")
)
p
【问题讨论】:
-
或许你可以看看
symbol:plot.ly/r/line-and-scatter