我正在尝试在我的Choropleth贴图上更改颜色主题,但是无论我使用colors =
指定什么,我都无法将贴图更改为默认值以外的其他颜色。有什么想法吗?
g <- list(
scope = 'usa',
projection = list(type = 'albers usa'),
showlakes = FALSE,
lakecolor = toRGB('white')
)
fig <- plot_geo(purple_states, locationmode = 'USA-states')
fig <- fig %>% add_trace(
z = ~swing, locations = ~abb,
color = ~purple_states, colors = 'Purples', frame = ~year,
zmin = -0.5, zmax = 0.5
)
fig <- fig %>% colorbar(title = 'Swing')
fig <- fig %>% layout(
title = 'US Presidential Election Electoral College Results 1948-2016',
geo = g
)
fig