0

This question is a follow-up to this post: previous post

I have 28 variables, M1, M2, ..., M28, for which I compute certain statistics x and y.

 library(ggplot2)
 df = data.frame(model = factor(paste("M", 1:28, sep = ""), levels=paste("M", 1:28, sep = "")), a = runif(28, 1, 1.05), b = runif(28, 1, 1.05))

 levels = seq(0.8, 1.2, 0.05)

Here is the plot:

 ggplot(data=df) + 
   geom_polygon(aes(x=model, y=a, group=1), color = "black", fill = NA) + 
   geom_polygon(aes(x=model, y=b, group=1), color = "blue", fill = NA) +
   coord_polar() + 
   scale_y_continuous(limits=range(levels), breaks=levels, labels=levels) +
   theme(axis.text.y = element_blank(), axis.ticks = element_blank(), axis.title.x = element_blank(), axis.title.y = element_blank())

I would like to add a point the the plot, with y-value = 1 for M1 (model1). I tried adding:

 geom_point(aes(y = 1, x = "M1"), color = "red", cex = 0.5)

but it doesn't work. Any idea what I am doing wrong?

Thanks for your help!

7
  • 1
    worked for me. What do you mean by doesn't work? Commented Feb 3, 2014 at 20:44
  • The point doesn't show-up :S:S Commented Feb 3, 2014 at 20:45
  • What's not working? It adds a point here... Commented Feb 3, 2014 at 20:45
  • was about to suggest the same Commented Feb 3, 2014 at 20:45
  • didn't forget the +... very odd Commented Feb 3, 2014 at 20:45

1 Answer 1

2

cex is not an argument for geom_point. Try size, e.g.

geom_point(aes(y = 1, x = "M1"), color = "red", size = 10)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.