I have a database df that has information of Covid effect for some countries in the world during January-July 2020. Following the code in https://www.youtube.com/watch?v=RrtqBYLf404 I have created the following dynamic map.
library(plotly)
graph = plot_geo(df,
locationmode = "country-names",
frame = ~month) %>%
add_trace(locations = ~iso,
z = ~effect_covid_avg,
zmin = min(df$effect_covid_avg),
zmax = max(df$effect_covid_avg),
color = ~effect_covid_avg,
colorscale = 'Hot', #colorscale = 'heat', 'diverging', #colorscale = 'YlOrRd',
text = ~hover,
hoverinfo = 'text')
graph
However, I want to take screenshots of some months so I can include them into a static pdf file. I want to make some modifications so to have:
- Color of the palette (blue for positive, red for negative, whiter for 0). As you can see I have tried several palettes, not succesfully ('heat', 'diverging', 'YlOrRd').
- Include the color legend inside the plot.
One of my screenshots looks like this.
Any clue?
Thank you