You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to change the plot titles to italics and I have done some reading. I can't tell if this is expected behavior or not, particularly for the solution where I call patchwork explicitly to wrap the plots. That to me makes no sense. There is probably an easy/obvious way to do this that I need to learn. Apologies if others have asked this but I tried several solutions of others which were not successful and nothing that provided the exact question I am struggling with. Below are the approaches that I tried that were closest. I think with some pointer about what might be going wrong I can fix it.
##produces output where the default theme is applied for all 16 genes
p
##produces correct output but only for the first 11 genes after which the output stops unexpectedly.
patchwork::wrap_plots(lapply(p, function(x){x + theme(plot.title=element_text(face="italic"))}))
##produces output where the first 15 genes are the default theme, and the last gene only is changed to italics. I think this is expected behavior where it doesn't iterate through the plots before paneling them in patchwork?
p + theme(plot.title=element_text(face="italic"))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to change the plot titles to italics and I have done some reading. I can't tell if this is expected behavior or not, particularly for the solution where I call patchwork explicitly to wrap the plots. That to me makes no sense. There is probably an easy/obvious way to do this that I need to learn. Apologies if others have asked this but I tried several solutions of others which were not successful and nothing that provided the exact question I am struggling with. Below are the approaches that I tried that were closest. I think with some pointer about what might be going wrong I can fix it.
FeaturePlot(data, "Gene1") ##Works as expected
p <- FeaturePlot(data, features=c("Gene1", "Gene2","Gene3", "Gene4", "Gene5", "Gene6","Gene7", "Gene8", "Gene9", "Gene10","Gene11", "Gene12", "Gene13","Gene14", "Gene15", "Gene16"), combine=TRUE)
##produces output where the default theme is applied for all 16 genes
p
##produces correct output but only for the first 11 genes after which the output stops unexpectedly.
patchwork::wrap_plots(lapply(p, function(x){x + theme(plot.title=element_text(face="italic"))}))
##produces output where the first 15 genes are the default theme, and the last gene only is changed to italics. I think this is expected behavior where it doesn't iterate through the plots before paneling them in patchwork?
p + theme(plot.title=element_text(face="italic"))
Beta Was this translation helpful? Give feedback.
All reactions