R ggplot2 position_dodge()` requires non-overlapping x intervals warning - r

I get a position_dodge() requires non-overlapping x intervals` warning with the following data and code. If I omit the width = 3 option then I don't get the warning but the columns are almost impossible to distinguish. The plot of the ggplot code has lots of space between each set of columns so I wonder if anyone has a suggestion on what I need to change to get ride of the warning.
library(ggplot2)
g_crop <- ggplot(cumsum_2022_melt, aes(fill = variable, y = quantity, x = as.Date(date))) +
geom_col(position="dodge", width = 3)
dput output
structure(list(date = structure(c(1657152000, 1657497600, 1657756800,
1657843200, 1658102400, 1658966400, 1659571200, 1660176000, 1660780800,
1661385600, 1661990400, 1662595200, 1663286400, 1663545600, 1664323200,
1657152000, 1657497600, 1657756800, 1657843200, 1658102400, 1658966400,
1659571200, 1660176000, 1660780800, 1661385600, 1661990400, 1662595200,
1663286400, 1663545600, 1664323200, 1657152000, 1657497600, 1657756800,
1657843200, 1658102400, 1658966400, 1659571200, 1660176000, 1660780800,
1661385600, 1661990400, 1662595200, 1663286400, 1663545600, 1664323200,
1657152000, 1657497600, 1657756800, 1657843200, 1658102400, 1658966400,
1659571200, 1660176000, 1660780800, 1661385600, 1661990400, 1662595200,
1663286400, 1663545600, 1664323200), class = c("POSIXct", "POSIXt"
), tzone = "UTC"), variable = c("chard plot 1", "chard plot 1",
"chard plot 1", "chard plot 1", "chard plot 1", "chard plot 1",
"chard plot 1", "chard plot 1", "chard plot 1", "chard plot 1",
"chard plot 1", "chard plot 1", "chard plot 1", "chard plot 1",
"chard plot 1", "chard plot 2", "chard plot 2", "chard plot 2",
"chard plot 2", "chard plot 2", "chard plot 2", "chard plot 2",
"chard plot 2", "chard plot 2", "chard plot 2", "chard plot 2",
"chard plot 2", "chard plot 2", "chard plot 2", "chard plot 2",
"chard plot 3", "chard plot 3", "chard plot 3", "chard plot 3",
"chard plot 3", "chard plot 3", "chard plot 3", "chard plot 3",
"chard plot 3", "chard plot 3", "chard plot 3", "chard plot 3",
"chard plot 3", "chard plot 3", "chard plot 3", "chard plot 4",
"chard plot 4", "chard plot 4", "chard plot 4", "chard plot 4",
"chard plot 4", "chard plot 4", "chard plot 4", "chard plot 4",
"chard plot 4", "chard plot 4", "chard plot 4", "chard plot 4",
"chard plot 4", "chard plot 4"), quantity = c(0, 0, 0, 7.4, 7.4,
17.82, 27.37, 32.32, 35.37, 38.77, 41.62, 45.27, 45.27, 48.82,
54.17, 0, 0, 0, 0.35, 0.35, 0.35, 1.7, 3.3, 4.2, 6, 7.3, 7.3,
7.3, 10, 12.4, 0, 0, 0, 1, 1, 1, 1, 4.3, 9.55, 9.55, 10.05, 12.85,
12.85, 14.65, 16.65, 0, 0, 0, 2.3, 2.3, 9, 11.75, 13.85, 16.5,
19.55, 20.45, 21.95, 21.95, 23.2, 25.65)), row.names = c(NA,
-60L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x135841ce0>, index = structure(integer(0), "`__variable`" = integer(0)))

I don't know what the difference is, however I always use dodge2 instead of dodge. It seems to works in your situation as well:
https://ggplot2.tidyverse.org/reference/position_dodge.html
library(ggplot2)
#g_crop <-
ggplot(cumsum_2022_melt, aes(fill = variable, y = quantity, x = as.Date(date))) +
geom_col(position="dodge2", width=3)
Something funny is happening with the bars on the left, they are smaller then the rest of the bars. Maybe due to the records with zero data? This link talks about it: Consistent width for geom_bar in the event of missing data
Trying this solution:
ggplot(cumsum_2022_melt, aes(fill = variable, y = quantity, x = as.Date(date))) +
geom_bar(position=position_dodge2(preserve = "single"), stat="identity", width=2)

The reason you are getting the warning is because ggplot2 observes that your data has daily resolution, in that it is not aligned to any longer time grid. As such, it will throw a warning when your dodging will cause a grouping to be wider than one day, since that risks the data having overlapping x intervals. It's a bit of false alarm here, since most of your groups are 7+ days from their neighbors.
Since the visualization is otherwise what you want, the warning can be safely ignored.
If you care about avoiding it, but you don't care about the precise alignment of your data to the specified dates, one option would be to align your data by week, such that ggplot recognizes that there are 7 days of width (ie width 7) that can be accommodated between groups. This doesn't throw a warning.
ggplot(cumsum_2022_melt, aes(fill = variable, y = quantity,
x = lubridate::floor_date(as.Date(date), "week"))) +
geom_col(position="dodge", width = 6)

Related

How to put my boxplots belonging to different categories on different scales

Here is my dataset
structure(list(id_data = c("20", "63", "93", "156", "162", "177",
"38_", "44_", "57_", "63_", "73_", "79_", "105_", "111_", "154_",
"156_", "158_", "168_", "20", "63", "93", "156", "162", "177",
"38_", "44_", "57_", "63_", "73_", "79_", "105_", "111_", "154_",
"156_", "158_", "168_", "20", "63", "93", "156", "162", "177",
"38_", "44_", "57_", "63_", "73_", "79_", "105_", "111_", "154_",
"156_", "158_", "168_"), bras = c("Treatment 2", "Treatment 2",
"Treatment 2", "Treatment 2", "Treatment 2", "Treatment 2", "Treatment 1",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 2", "Treatment 2", "Treatment 2", "Treatment 2",
"Treatment 2", "Treatment 2", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 2",
"Treatment 2", "Treatment 2", "Treatment 2", "Treatment 2", "Treatment 2",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1", "Treatment 1",
"Treatment 1", "Treatment 1"), Progesterone = c(0.2, 0.21, 0.17,
0.19, 0.2, 0.46, 60, 21.6, 40.73, 34.07, 25.5, 60, 38.5, 60,
16.36, 48.7, 22, 32.73, 0.2, 0.21, 0.2, 0.25, 0.2, 0.46, 38.49,
7.22, 60, 23.03, 12.8, 57.14, 2.36, 46.1, 10.1, 14.21, 1.38,
33.58, 0.25, 0.4, 0.39, 0.3, 0.2, 0.96, 15.2, 7.55, 12.46, 6.68,
12.8, 15.92, 0.62, 2.71, 10.14, 14.21, 1.38, 2.51), Period = c("Time 1",
"Time 1", "Time 1", "Time 1", "Time 1", "Time 1", "Time 1", "Time 1",
"Time 1", "Time 1", "Time 1", "Time 1", "Time 1", "Time 1", "Time 1",
"Time 1", "Time 1", "Time 1", "Time 2", "Time 2", "Time 2", "Time 2",
"Time 2", "Time 2", "Time 2", "Time 2", "Time 2", "Time 2", "Time 2",
"Time 2", "Time 2", "Time 2", "Time 2", "Time 2", "Time 2", "Time 2",
"Time 3", "Time 3", "Time 3", "Time 3", "Time 3", "Time 3", "Time 3",
"Time 3", "Time 3", "Time 3", "Time 3", "Time 3", "Time 3", "Time 3",
"Time 3", "Time 3", "Time 3", "Time 3")), row.names = c(NA, -54L
), class = "data.frame")
I made boxplots by Treatment and period
ggplot(mydata,
aes(x=Progesterone, y=bras,fill=bras ))+
geom_boxplot()+coord_flip()+
facet_grid(cols = vars(Period))
But the difference in the magnitude of the values between the two treatments is so great that the boxplots of treatment 2 are no longer visible. I don't want to do a logarithmic transformation or normalization but rather to make the scales of the two treatment groups different (while keeping the boxplots of the two groups side by side (as in the figures below)
Do you think this is possible?
You could do this with the scale="free_y" parameter of facet_wrap, which gives you this:
ggplot(mydata, aes(x = Period, y = Progesterone, fill = bras)) +
geom_boxplot() +
facet_wrap(~bras, nrow = 1, scale = "free_y")
However, I don't recommend this. A plot like this can look very misleading, since it's easy to overlook that the scales are different. I recommend that you plot all 6 on the same scale (as in your question), and then add a clearly labelled, separate "zoomed in" panel to show the relative distributions of Treatment 2.
Incidentally, I've tidied up your ggplot a bit - there's no need to coord_flip(), just assign the coordinates you want in the first place!

Add additional text outside of dotwhisker plot

I have a tidy dataframe with multiple models that I'm plotting as a dotwhisker plot. Below I've recreated a similar dataframe. This plot requires a caption explaining information about the predictors, and ideally it would go underneath the legend. I have tried doing this as a caption, tag, and annotation, and each time the addition of the brackets on the side causes a problem with the formatting. Is there a way to add additional text here without the brackets causing a formatting issue?
#create dataframe
results_df <- data.frame(
model = c("Model 1", "Model 1", "Model 1",
"Model 1", "Model 1", "Model 1",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2",
"Model 3", "Model 3", "Model 3",
"Model 3", "Model 3", "Model 3",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2"),
estimate = c(-0.4890, 0.0966, -0.0911, -0.1700, 0.3620, 0.1980, -2.0920,
-1.1620, -1.6910,-1.5320, -0.8340, -1.4350, 0.8240, 0.9750,
0.9650, 0.5210, 0.9190, 0.9560, -0.9580, -0.1950, -1.1470,
-2.6430,-1.7420, -2.2500, -2.9990, -1.8100, -1.8270),
conf.low = c(-0.6, 0.0, -0.2,-0.6, 0.0, -0.2, -2.4, -1.8, -1.9, -2.4,
-1.8, -1.9, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, -3.0, -2.0,
-1.9, -5.6, -3.6, -3.8, -3.0, -2.0, -1.9),
conf.high = c(0.9, 1.1, 1.0, 0.9, 1.1, 1.0, 0.0, 0.5, 0.7, 0.0, 0.5, 0.7,
0.9, 1.1, 1.0, 0.9, 1.1, 1.0, 0.0, 0.5, 0.7, 0.0,0.5, 0.7,
0.0, 0.5, 0.7),
term = c("A","B","C","A","B","C","A","B","C","A",
"B","C","A","B","C","A","B","C","D","E",
"F","G","H","I","J","K",
"L"),
fixed = c("Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects",
"With Fixed Effects", "With Fixed Effects", "With Fixed Effects",
"Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects",
"With Fixed Effects", "With Fixed Effects", "With Fixed Effects",
"Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects",
"With Fixed Effects", "With Fixed Effects", "With Fixed Effects",
"Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects",
"Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects",
"Without Fixed Effects", "Without Fixed Effects", "Without Fixed Effects"),
type = c("Model 1", "Model 1", "Model 1",
"Model 1", "Model 1", "Model 1",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2",
"Model 3", "Model 3", "Model 3",
"Model 3", "Model 3", "Model 3",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2",
"Model 2", "Model 2", "Model 2")
)
#recode model
results_df$model = results_df$type
#create dotwhisker
full_graph = dwplot(results_df,
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(aes(shape = fixed)),
whisker_args = list(aes(colour = model)))
#add graph elements
full_graph = full_graph +
theme_bw() +
theme(legend.justification=c(.02, .993),
legend.background = element_rect(color="gray90"),
plot.title = element_text(hjust = 0.52)) + #here is where I've tried using plot.caption and plot.tag, plot.tag.position
xlab("Coefficient Estimate") +
geom_vline(xintercept = 0, colour = "grey60", linetype = 2) +
ggtitle("Graph Title") +
scale_color_manual(name="Model",values=c("#52D871","#17D0E5","#EF5B3D"),
na.translate = F)+
scale_shape_manual(name = "Shape",values=c(16,17,16,17,16,17), na.translate = F)+
scale_fill_manual(name="Model",values = c("#52D871","#17D0E5","#EF5B3D"),
na.translate = F)
#add brackets
brackets = list(c("Bracket 1", "A", "C"),
c("Bracket 2", "D", "F"),
c("Bracket 3", "G", "I"),
c("Bracket 4","J","L"))
full_plot = full_graph %>% add_brackets(brackets)
Image of graph:
I'm not sure what you mean by the formatting being messed up. You could add a caption under the legend like this:
full_plot +
labs(caption = "Here's a caption explaining
what the different colors
and shapes represent ") +
theme(plot.caption = element_text(vjust = 70, hjust = 0.9, size = 12))

Combine stat_compare_means with facet in r: calculates p value only for 1 facet

I try to plot my data using this R code:
print(ggplot(data = my_data3, aes(x = Visit, y = Variable1, group = number)) +
geom_point(aes(col=Treatment), size = 2) +
geom_line(aes(col=Treatment)) +
facet_grid(. ~ Treatment) +
ggtitle("Variable1")+
theme_bw() +
stat_compare_means(comparisons = list(c("visit 1", "visit 2")), label = "p.format", method = "wilcox.test", paired=T, tip.length = 0))
My Variable3 contains 2 variables that are plotted as 2 graphs when I use the facet_grid function. However, the p value is only shown for one of the plots. How can I get the p value for both plots?Graph showing the p value for 1 facet
This is part of the dataset:
my_data3 <- structure(list(number = c(110002, 110002, 110003, 110003, 110004,
110004, 110005, 110005, 110006, 110006, 110007, 110007, 110008,
110008, 110009, 110009, 110010, 110010, 110011, 110011, 110012,
110012, 110013, 110013, 110014, 110014, 110016, 110016, 110017,
110017), Treatment = c("Treatment1", "Treatment1", "Treatment2",
"Treatment2", "Treatment2", "Treatment2", "Treatment2", "Treatment2",
"Treatment1", "Treatment1", "Treatment1", "Treatment1", "Treatment2",
"Treatment2", "Treatment2", "Treatment2", "Treatment1", "Treatment1",
"Treatment2", "Treatment2", "Treatment1", "Treatment1", "Treatment2",
"Treatment2", "Treatment2", "Treatment2", "Treatment1", "Treatment1",
"Treatment2", "Treatment2"), Visit = c("visit 1", "visit 2",
"visit 1", "visit 2", "visit 1", "visit 2", "visit 1", "visit 2",
"visit 1", "visit 2", "visit 1", "visit 2", "visit 1", "visit 2",
"visit 1", "visit 2", "visit 1", "visit 2", "visit 1", "visit 2",
"visit 1", "visit 2", "visit 1", "visit 2", "visit 1", "visit 2",
"visit 1", "visit 2", "visit 1", "visit 2"), Variable1 = c(5618,
4480.5, 1034.75, 706.75, 11492.5, 6037.5, 3841.5, 2762.75, 306,
138.5, 259.5, 0, 31.5, 911.75, 1909.5, 1352.75, 1957.75, 2383.25,
23538.25, 8595.5, 13360.5, 10337.5, 1696.5, 805.25, 14655, 6169,
10141, 5922.25, 2164.25, 14990.25)), .Names = c("number", "Treatment",
"Visit", "Variable1"), row.names = c(NA, 30L), class = "data.frame")
I ran into a similar problem today, so I'll leave the answer here in case anyone else needs it in the future:
It seems that stat_compare_means struggles when you include a grouping variable in the general aesthetics of the plot (using group, color, fill, etc), so you should move these to the aesthetics of the specific function where you want to use them.
For your code, I only had to move the group = number argument inside the geom_line function and the problem was solved:
ggplot(data = my_data3, aes(x = Visit, y = Variable1)) +
geom_point(aes(col=Treatment), size = 2) +
geom_line(aes(col=Treatment, group = number)) +
facet_grid(. ~ Treatment) +
ggtitle("Variable1")+
theme_bw() +
stat_compare_means(comparisons = list(c("visit 1", "visit 2")),
label = "p.format", method = "wilcox.test", paired=T, tip.length = 0)

ggplot2: Different legend symbols for points and lines

already searched all related threads about this but could not find a solution.
Here is my code and the attached plot result:
g <-ggplot(NDVI2, aes(LAI2, NDVI, colour = Legend)) +
theme_bw (base_family = "Times") +
scale_colour_manual (values = c("purple", "green", "blue", "yellow", "magenta","orange", "cyan", "red", "black")) +
geom_point (size = 3) +
geom_smooth (aes(group = 1, colour = "Trendline"), method = "loess", size = 1, linetype = 5, se = FALSE) +
geom_smooth (aes(group = 1, colour = "Regression (log)"),linetype = 1, size=1.2,method = "lm", formula = y~ log(x), se = FALSE) +
labs (title = "Correlation of LAI and NDVI")+
theme (legend.title = element_text (size = 15))
Which results in this plot:
As you can see, all Legend Icons look the same. What I want is that the points are shown as points and the two lines ("Regression" and "Trendline") are shown as lines.
I tried to use
guides (colour = guide_legend (override.aes = list(size = 1.5)))
but that gives me again all icons in the same way and I can not figure out how to distinguish between them
I´m new to R and this is my first "complex" plot. Try to figure out most with online helps and google but can´t find a solution for this problem. Thank you all for your time and help!
Here a dput of my data:
dput(NDVI2)
structure(list(MeanRED = c(3.240264, 6.97950484, 3.75052276,
4.62617908, 4.07743944, 4.88961572, 3.15865532, 2.28368236, 3.40793788,
4.28833416, 4.52529496, 2.45698208, 3.84003364, 4.31006672, 3.29672264,
4.21926652, 4.64357012, 3.94445908, 3.95942484, 1.22673756, 4.70933136,
5.33718396, 5.71857348, 5.7014266, 3.85938572, 6.07816804, 2.93602476,
5.00289296), MeanNIR = c(46.8226195806452, 48.4417953548387,
47.8913064516129, 43.9416386774194, 44.7524788709677, 52.2142607741935,
48.6422146774194, 44.6617992580645, 57.7213822580645, 58.5066447096774,
56.6924350967742, 57.4100250967742, 58.0419292903226, 58.7054423225806,
58.5283540645161, 54.7658463548387, 58.8950077096774, 58.2421209354839,
57.8538210645161, 50.209727516129, 59.5780209354839, 60.1662100645161,
62.1929408387097, 60.3309026451613, 57.859932516129, 63.5678422258065,
55.2536370967742, 60.1808743548387), NDVI = c(0.870552242769623,
0.748129155560663, 0.854748647859414, 0.809496111062421, 0.832994214160536,
0.828746627367857, 0.878046244390978, 0.902709173224405, 0.888500710549276,
0.863417928083076, 0.852157374806182, 0.917918660181389, 0.875891666709934,
0.863206160341016, 0.893353221193523, 0.856937918252258, 0.853834622095331,
0.873141147848366, 0.871890732089488, 0.952300860559358, 0.853491201866442,
0.837040994913869, 0.831587513918106, 0.827314084928549, 0.874937512911774,
0.825455384542418, 0.899087753174211, 0.846498808949291), LAI2 = c(1.1,
1.2, 1.3, 1.4, 2.1, 2.2, 2.3, 2.4, 3.1, 3.2, 3.3, 3.4, 4.1, 4.2,
4.3, 4.4, 5.1, 5.2, 5.3, 5.4, 6.1, 6.2, 6.3, 6.4, 7.1, 7.2, 7.3,
7.4), Legend = c("LAI 1", "LAI 1", "LAI 1", "LAI 1", "LAI 2",
"LAI 2", "LAI 2", "LAI 2", "LAI 3", "LAI 3", "LAI 3", "LAI 3",
"LAI 4", "LAI 4", "LAI 4", "LAI 4", "LAI 5", "LAI 5", "LAI 5",
"LAI 5", "LAI 6", "LAI 6", "LAI 6", "LAI 6", "LAI 7", "LAI 7",
"LAI 7", "LAI 7")), .Names = c("MeanRED", "MeanNIR", "NDVI",
"LAI2", "Legend"), class = "data.frame", row.names = c("LAI 1-1",
"LAI 1-2", "LAI 1-3", "LAI 1-4", "LAI 2-1", "LAI 2-2", "LAI 2-3",
"LAI 2-4", "LAI 3-1", "LAI 3-2", "LAI 3-3", "LAI 3-4", "LAI 4-1",
"LAI 4-2", "LAI 4-3", "LAI 4-4", "LAI 5-1", "LAI 5-2", "LAI 5-3",
"LAI 5-4", "LAI 6-1", "LAI 6-2", "LAI 6-3", "LAI 6-4", "LAI 7-1",
"LAI 7-2", "LAI 7-3", "LAI 7-4"))
override.aes is definitely a good start for customizing the legend. In your case you may remove unwanted shape in the legend by setting them to NA, and set unwanted linetype to blank:
ggplot(data = NDVI2, aes(x = LAI2, y = NDVI, colour = Legend)) +
geom_point(size = 3) +
geom_smooth(aes(group = 1, colour = "Trendline"),
method = "loess", se = FALSE, linetype = "dashed") +
geom_smooth(aes(group = 1, colour = "Regression (log)"),
method = "lm", formula = y ~ log(x), se = FALSE, linetype = "solid") +
scale_colour_manual(values = c("purple", "green", "blue", "yellow", "magenta","orange", "cyan", "red", "black"),
guide = guide_legend(override.aes = list(
linetype = c(rep("blank", 7), "solid", "dashed"),
shape = c(rep(16, 7), NA, NA))))

How to set strip label font size in lattice graphics in R

I've created a lattice plot with three panels. I can control the font size for the axis and tick labels, but I haven't been able to figure out how to increase the font size of the strip labels. Here's a concrete example:
# See below for the fake data to run this code
library(lattice)
barchart(choice ~ yes+no+not.app|group, data=data,
stack=TRUE, col=c("green","red","blue"),
xlim=c(0,100), layout=c(3,1),
scales=list(cex=c(1.4,1.4), alternating=3),
xlab=list(label="Percent of Respondents", fontsize=20),
main="")
Here's the graph this code produces. Note how all the fonts are nice and big except for the strip labels ("Group 1", "Group 2", "Group 3"). I've been fishing around R-help and Stack Overflow, but haven't been able to work this one out. Does anyone know the magic incantation?
data = structure(list(choice = c("Choice 1", "Choice 1", "Choice 1",
"Choice 2", "Choice 2", "Choice 2", "Choice 3", "Choice 3", "Choice 3",
"Choice 4", "Choice 4", "Choice 4"), group = c("Group 1", "Group 2",
"Group 3", "Group 1", "Group 2", "Group 3", "Group 1", "Group 2",
"Group 3", "Group 1", "Group 2", "Group 3"), yes = c(23.53, 20.47,
22.94, 16.51, 16.54, 16.51, 9.68, 13.39, 10.4, 24.48, 29.92,
25.54), no = c(41.37, 37.01, 40.52, 48.39, 40.94, 46.94, 55.22,
44.09, 53.06, 40.42, 27.56, 37.92), not.app = c(35.1, 42.52,
36.54, 35.1, 42.52, 36.54, 35.1, 42.52, 36.54, 35.1, 42.52, 36.54
)), .Names = c("choice", "group", "yes", "no", "not.app"), row.names = c(NA,
12L), class = "data.frame")
Try this (good work on supplying an example):
barchart(choice ~ yes+no+not.app|group, data=data,
par.strip.text=list(cex=2),
stack=TRUE, col=c("green","red","blue"),
xlim=c(0,100), layout=c(3,1),
scales=list(cex=c(1.4,1.4), alternating=3),
xlab=list(label="Percent of Respondents", fontsize=20),
main="")
To see more about how to manage the strip features type : ?strip.default There are other levers to throw in strip.custom. Also see the latticeExtra package that has the capacity to put strips on the sides with useOuterStrips.

Resources