Suppressing only some labels...

19 views
Skip to first unread message

Steve Mack

unread,
Sep 13, 2014, 5:07:52 PM9/13/14
to ggp...@googlegroups.com
  • Say I have a data frame with a field named "Method" that has 4 factors, A, B, C, D.
  • I am using the geom_point() function, I discriminate the data points by aes(color = "Method")
  • I want to attach x-axis labels but only to the data points associated with Method = "A"
New to ggplot2, Appreciate any assistance.

Thanks,

Steve

Roman Luštrik

unread,
Sep 14, 2014, 7:35:58 AM9/14/14
to Steve Mack, ggplot2
I would subset the data frame, drop unused factor levels using `droplevels()` and plot that.

HTH,
Roman


--
--
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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
In God we trust, all others bring data.

Steve Mack

unread,
Sep 14, 2014, 9:21:09 AM9/14/14
to ggp...@googlegroups.com, sbm...@gmail.com

Thanks, but I want to plot all the points, but only label the factor "A" points.

Roman Luštrik

unread,
Sep 14, 2014, 2:13:01 PM9/14/14
to Steve Mack, ggplot2
Then use that subsetted data.frame to use that in `geom_text`.

Roman
Reply all
Reply to author
Forward
0 new messages