Home > Mobile >  Single color plotly map
Single color plotly map

Time:01-07

How can I render a plotly map with only a single color. In the example below, I would like the fill for all states to be red, or #FF0000.

library(plotly)
library(tidyverse)

dat <- data.frame(state = state.abb)

plot_ly(dat,
        type = "choropleth",
        locationmode = 'USA-states',
        locations = ~state) %>% 
  add_trace(color = "red") %>%
  layout(geo = list(
    projection = list(
      type = "albers usa")))

enter image description here

CodePudding user response:

From what I understand of the plotly enter image description here

  •  Tags:  
  • Related