0

I have dataset about physician in cities in Turkey. For example :

Physician :
    ISTANBUL  0.9 physician
    ADANA     0.7 physician
    ANKARA    1.8 physician
    ....

Specialist:
    ISTANBUL  0.1 specialist
    ADANA     0.7 specialist
    ANKARA    0.4 specialist

I want to show on map this data but my problem is : while i'm creating map , i want to fill colour like this :

(0) -Red

(0-0.25) -Orange

(0.25-0.50) -Blue

(0.50-0.75) - Dark Blue

(0.75>) - Green

my ggplot code :

ggplot(Physician) +
  geom_polygon( aes(x = long, y = lat, group = group, fill = Doluluk), color = "#D7C2C2") +
   coord_map()+
  scale_fill_gradientn(colours=c('Red', 'Orange', 'Blue', 'Darkblue','Green'),
   values   = c(0,0.25,0.5,0.75),
   breaks   = c(0,0.25,0.5,0.75),
   oob      = identity)

but , it does not work. Can anyone help pls ?

  • 2
    Check out this answer for some suggestions: https://stackoverflow.com/questions/24264404/insert-color-into-scale-fill-gradient-at-specified-location-value-in-ggplot2. It would be easier to help and test with a proper [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Nov 13 '20 at 08:11
  • Thanks but not work for my request :( – Baki Selim Nov 13 '20 at 08:13
  • 1
    What exactly does "doesn't work" mean in this case? What exactly is wrong with the result? We can't see the current plot because we don't have the data. Maybe this one instead: https://stackoverflow.com/questions/41985921/specify-manual-values-for-scale-gradientn-with-transformed-color-fill-variable – MrFlick Nov 13 '20 at 08:15

0 Answers0