![]() ![]() This is how the plot would look if we didn’t make any alterations to any of the labels. Next, let’s make a simple panel of scatter plots using ggplot(), coloring the points by the variable ‘c’ and creating two panels so that the points are grouped by the variable ‘d’: ggplot(data) + ![]() Next, let’s generate some random data for plotting (I’m including two binary variables for grouping purposes): data = ame(x = rnorm(50), The problem was, I had no clue how to do this! So, I consulted #rstats Twitter, got some really great tips, and figured that I’d share them all in a quick demo blogpost (mostly so that I can easily find this info the next time I need it! □).įirst, let’s load the necessary packages: library(dplyr) library(ggplot2) library(scales) ![]() I wanted to label certain axes and panel names using the Greek letters I had used as parameter notation, and I also wanted the labels in the color legend to correspond to the different regression models I had fit. ![]() The plot features several panels using facet_grid(), and uses colors to distinguish between different regression models that were fit to the simulated data. Yesterday, I was trying to put some finishing touches on a figure I made in ggplot2 that visualizes some simulation results. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |