Questions tagged [facet-wrap]

In R graphics system ggplot2, facet_wrap is a way to wrap a 1d ribbon of panels into 2d shape. Typically, it groups a data set by one or more categorical variables or variables coercible to factor and plots one data group per panel using the same aesthetics mappings.

In R graphics system ggplot2, facet_wrap is a way to wrap a 1d ribbon of panels into 2d shape. Typically, it groups a data set by one or more categorical variables or variables coercible to factor and plots one data group per panel using the same aesthetics mappings.

Resources for using facet_wrap:

873 questions
0
votes
1 answer
0
votes
1 answer

Parse plot lines by more than one variable ggplot

I am desiring to plot two levels of data (high, low) for two days (day o, day 1) for both male and female subjects. I have been success in faceting by day and by level. However I am unsuccessful of combining and identifying the genders. I would…
tcek
  • 51
  • 4
0
votes
0 answers

multiple plots with multple datas and a lot of scaling issues

I am trying to compare two sets of data for multiple locations on an individual chart for each location.. data has structure gw <- well.id date benzene bgs bgs is depth to water (below ground surface) in feet. (I want to reverse this…
c0ba1t
  • 241
  • 2
  • 15
0
votes
1 answer

X-axis labels on uneven facet_wrap rows

Currently, I am trying to plot a dataset where there the number of facets is odd, leaving an incomplete final row in the plot. Ideally, I would like x-axis labels below each of the incomplete final row and the row above, where the bottom row is…
obfuscation
  • 1,023
  • 3
  • 16
  • 23
0
votes
1 answer

add labels to facet_wrap boxplot

I'm trying to modify the facet labels in the plot created in this post. To repeat the code: library(ggplot2) mymatrix1 <- matrix(data = 0, nrow = 105, ncol =2) mymatrix2 <- matrix(data = 0, nrow = 108, ncol =2) mymatrix3 <- matrix(data = 0, nrow =…
jhomsy
  • 3
  • 1
0
votes
1 answer

set limits for scale_x_date in ggplot2 in facet_grid context

I have a data frame named "a" as : date individus annee 80 2013-07-23 0 2013 77 2013-07-12 0 2013 63 2013-05-13 7 2013 72 2013-06-25 2 2013 7 2011-04-19 20 2011 58 2013-04-23 6 …
delaye
  • 1,357
  • 27
  • 45
0
votes
1 answer

Creating a facet_wrap plot with ggplot2 with less annotations than plots

I am using ggplot2 to plot a figure that contains nine facets. Each facet represents the relationship between two variables and I would like to annotate the facets that display statistically significant results with a star ''. This would result in…
EduardoSAS
  • 23
  • 3
0
votes
1 answer

How to plot with minimum no. of observations using facet_wrap, ggplot2

Have searched for the answer to this but cannot find anything relevant. I am plotting a dataframe using ggplot2 and facet_wrap to get multiple plots, which is working fine. The idea is to quickly look for trends in the x, y relationship. However, at…
laoisman
  • 61
  • 2
  • 7
0
votes
0 answers

x axis labels in ggplot facet_wrap

If the number of panels in the last row is different to the rows above, the x-axis labels are missing in a facet plot with ggplot2. How can I add these? For example: d <- ggplot(diamonds, aes(carat, price, colour=color)) d + geom_point() +…
user3460194
  • 511
  • 1
  • 4
  • 14
0
votes
0 answers

Plotting mean and SE with facet wrap in ggplot2

I have a dataset (b.data) containing information on marine species recorded in a survey. Each row relates to an individual animal with the column headings below: "Area" "Year" "Cruise" "Vessel" "Haul" "Haul_ID" "Common_name" "Scientific_Name"…
user3489562
  • 249
  • 1
  • 3
  • 11
0
votes
0 answers

GGplot2: Plot arbitrary number of histograms and scatterplots as facet?

I'd like to create a function that will conveniently accept a data frame, then, for each vector in the data frame, plot a histogram. For each additional vector (beyond the first), my function should also print possibly several scatterplots: the…
Jefftopia
  • 2,105
  • 1
  • 26
  • 45
0
votes
1 answer

facet wrap and no layers in plot

I have this code in R: p <- ggplot(data, aes(x = Price, y = ActionsCount)) p + geom_point(alpha = 0.25, aes(color = Medium)) p + coord_cartesian(xlim=c(0,300), ylim=c(0,40)) p + facet_wrap( ~ Medium) And the console returns: No layers in plot If I…
Petr Jirásek
  • 453
  • 1
  • 5
  • 17
0
votes
1 answer

facet only a subset of a dataset

I have the following data set: mdf <- structure(list(milieu = structure(c(3L, 9L, 8L, 6L, 10L, 2L, 1L, 7L, 5L, 4L, 3L, 9L, 8L, 6L, 10L, 2L, 1L, 7L, 5L, 4L, 3L, 9L, 8L, 6L, 10L, 2L, 1L, 7L, 5L, 4L, 3L, 9L, 8L, 6L, 10L, 2L, 1L, 7L, 5L, 4L, 3L, 9L,…
Dominik
  • 2,753
  • 7
  • 28
  • 32
0
votes
1 answer

Use of facet_wrap in ggplot2

Want facet_wrap to have different parameters for each plot. Example below: x = c(43,22,53,21,13,53,23,12,32) y = c(42,65,23,45,12,22,54,32,12) df = cbind(x,y) df = as.data.frame(df) meany = mean(y) p = ggplot(df, aes(x=x,y=y, colour=(y >…
user1807096
  • 25
  • 1
  • 2
  • 7
0
votes
1 answer

Create 4 percentage bar plot in same figure reseting to 0 the count in each one

I have a data frame (dat2) with: > summary(dat2) combs label Groups Min. : 1.00 Length:21172 (0,1] :1573 1st Qu.: 4.00 Class :character (1,5] :5777 Median : 9.00 Mode …
biojl
  • 1,060
  • 1
  • 8
  • 26