I'm following the model for building a choropleth map given on this page: https://plot.ly/r/county-level-choropleth/. The polygon colors are somewhat transparent, and nothing I've tried to change the opacity has had any effect.
library(ggplot2) # For the demo map data
library(plotly)
ohio_counties <- map_data('county', 'ohio')
# This id simulates the categorical variable I'm trying to represent with color
ohio_counties$id <- letters[ohio_counties$group %% 6 + 1]
ohio_counties %>%
group_by(group) %>%
plot_ly(x = ~long,
y = ~lat,
color = ~id) %>%
add_polygons(line = list(width = 0.4))
I've tried adding opacity = 1 as a parameter to the plot_ly() call and in add_polygons, and I've tried using my own custom color scales, but all appear to have the same amount of transparency. I can get rid of the grid lines, but then I'm still stuck with faded pastel colors.
EDIT: Compare a map made in Plotly versus another I made in Leaflet using the exact same palette, just to the show the difference between what I am getting and what I would like. (Ignore the background leaflet map and county lines, has no effect on the colors.)




