geom point scale_colour_gradient2

25 views
Skip to first unread message

Alina Vodonos Zilberg

unread,
Mar 6, 2018, 1:36:05 PM3/6/18
to ggplot2
Hi!

I am trying to change the color of the geom_point in my plot for the variable -concentration
summary(dat$concentration)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
  0.5502   5.2628  12.2493  21.4695  27.4057 205.3170 

mp <- NULL
mapWorld <- borders("world", colour="black", fill="white") # create a layer of borders
mp <- ggplot() +   mapWorld
mp

m1<-mp+ geom_point(data=dat, aes(x=lon, y=lat,color=concentration),alpha=0.6, size=2.5)+
  scale_colour_gradient2("concentration levels", low = "seashell1", mid = "lightsalmon3",
                         high = "tomato4", midpoint = 21, space = "Lab",
                         na.value = "grey50", guide = "colourbar")
m1


I want it to look something like that


Any ideas?

thank you!

Auto Generated Inline Image 1

Brandon Hurr

unread,
Mar 6, 2018, 5:39:51 PM3/6/18
to Alina Vodonos Zilberg, ggplot2
Alina,

Do you have some sample data that we could use to make a similar graph? I don't do a lot of mapping so it's really hard for me to make up an example here.

If you could make a reproducible example as described in the bottom of this email it would help us help you.

Thanks,
B

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages