0
managerLeftWrong$title = "Profession Subject, Left Map, Inumerate"
managerLeftWrong$legend= "% Evacuated"
managerLeftWrong$ggplot_scale = scale_fill_gradientn(colors = c("white", "dodgerblue4"), limits = c(0,100))
managerLeftWrong$set_zoom_zip(state_zoom=NULL, county_zoom=NULL, zip_zoom = c(coastal, zoneA, zoneB, zoneC), msa_zoom=NULL)
managerLeftWrong$set_num_colors(1)
managerLeftWrong$render()
managerLeftWrong$legend 

When I chekc managerLeftWrong$legend in the console, the console returns [1] "% Evacuated"

The $title works, but for some reason the legend doesn't. Does anyone have a fix for this?

  • I would like to help you with your problem. But the code, as written, does not work on my machine. Please follow the instructions written here on how to create a "reproducible example": https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example#5963610 – Ari Aug 31 '20 at 18:39
  • 1
    hey sorry, I figured it out. You can't use choro$legend = "legend name". You need to add it to the scale_fill_gradientn(name = "legend name") function – Anthony Fasano Sep 01 '20 at 00:00

1 Answers1

0

''''managerLeftWrong$ggplot_scale = scale_fill_gradientn(name = "% Evacuated", colors = c("white", "dodgerblue4"), limits = c(0,100))''''

I needed to add this instead