Questions tagged [cowplot]

The cowplot package is a simple add-on to ggplot2. It is meant to provide a theme for ggplot2 that is especially useful for formatting plots for publication in academic journals, and it also provides tools to neatly arrange multiple plots of different types, while minimizing the amount of required fiddling with sizes of axis labels, plot backgrounds, etc.

Cowplot

The cowplot package is a simple add-on to ggplot2. It is meant to provide a theme for ggplot2 that is especially useful for formatting plots for publication in academic journals, and it also provides tools to neatly arrange multiple plots of different types. while minimizing the amount of required fiddling with sizes of axis labels, plot backgrounds, etc.

Official CRAN Documentation

https://cran.r-project.org/web/packages/cowplot/index.html

CRAN Resources

284 questions
0
votes
0 answers

Using plot_grid (cowplot) to align ggplot and base r plot with the same x limits

I am trying to plot 2 scatterplots on top of each other, but I want to have the same limits on the x-axis so that the two plots are aligned. I tried: p1 <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + scale_x_continuous(limits =…
GabrielMontenegro
  • 683
  • 1
  • 6
  • 21
0
votes
1 answer

Modify space after adding annotate for multiplot panels

I have a multiplot panel with annotations (outside the plots) that I would like to modify. This is the plot: How can I: move the titles (I. and II.) over to the far left? change the amount of white space around the titles? change the amount of…
Blundering Ecologist
  • 1,199
  • 2
  • 14
  • 38
0
votes
3 answers

How to fix the error: could not find function "plot_grid"?

I'm try to do the Kaggle Project: Attrition in an Organization || Why Workers Quit? when I run a part of the code, which plot multiple graphs using R ggplot function "cowplot", library(ggplot2) options(repr.plot.width=8,…
Yusuf al-Imrani
  • 55
  • 1
  • 2
  • 9
0
votes
2 answers

Error when assembling plots with cowplot::plot_grid

I am using the following code to produce the scatter diagram of a Redundancy Analysis (RDA). The plot is for only one species and I am conducting this analysis for two other species (I am not showing the code for the other two species as it is…
0
votes
1 answer

cowplot plot_grid scales down size of plots automatically

I am trying to render a pdf with a series of 25 plots arranged in 6 columns using cowplot's function plot_grid. I would like these to show up the same size that they would appear if I had only one row. For some reasons though the size of plots gets…
BAlpine
  • 111
  • 3
  • 14
0
votes
1 answer

ggplot: Fill Boxplots Using the Package RColorBrewer + Plot Boxplots Using plot_grid() in the Cowplot Package in R

Overview I have a two data frames called 'ANOVA.Dataframe.1' and 'ANOVA.Dataframe.2' (see below). For this project, I have two aims: (1) Fill the boxplots using the package RColorBrewer; (2) Plot the boxplots using the package Cowplot Issues In…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
1 answer

Arrange faceted plots in a grid - how to completely remove facet labels to avoid overlapping

I am a bit stuck with the following: I want to arrange multiple (gg)plots into a grid with cowplot::plot_grid. Below is an example with two ggplots (g_bottom and g_top), both faceted. The bottom one has the facet labels deleted as they are…
Valentin_Ștefan
  • 6,130
  • 2
  • 45
  • 68
0
votes
1 answer

Adding labels to subplots in cowplot::gridplot in R

I am plotting several figures using grid plot like following. p.list <- list() for (i in 1:length(paths)){ p <- plotQC(get(paste0("sce_",i)), type = "highest-expression") p.list[[i]] <- p } cowplot::plot_grid(plotlist = p.list) How to add sub…
Angelo
  • 4,829
  • 7
  • 35
  • 56
0
votes
0 answers

Cannot scale legend size in draw_plot()

I cannot scale a legend when using the draw_plot function. df = data.frame(x=c(1,2,3), y=c(1,2,3), pval=c(0.01, 0.1, 1)) gg = ggplot(df, aes(x=x, y=y, color=pval))+geom_point() leg = get_legend(gg) gg + theme(legend.position = "none") + …
user7727736
  • 97
  • 1
  • 8
0
votes
1 answer

How to make several plots on the same page in R using cowplot package?

I am using built-in data set iris in R, I want to plot several graphs on the same page for which I am using cowplot package. However, the problem I face is that the labels in the figures i,e "A" and "B" overlap the y-axix. How can I lleave some…
M.R.Wani
  • 107
  • 1
  • 11
0
votes
2 answers

facet a set of facetted graphs

Is it possible to facet a set of faceted graphs? I'd love to facet_wrap a set of faceted graphs. The best I came up with is a cowplot solution that doesn't work all that well. Ideally, we wouldn't have to write separate graph…
Alex Coppock
  • 2,122
  • 3
  • 15
  • 31
0
votes
1 answer

ggplot2 - How to add labels to multiple plots figure?

I need to add one x label and one y label to the following multiple plots figure using cowplot: library(ggplot2 set.seed(99) x_1 = data.frame(z = rnorm(100)) x_2 = data.frame(z = rnorm(100)) x_3 = data.frame(z = rnorm(100)) lst = list(x_1, x_2,…
aaaaa
  • 149
  • 2
  • 18
  • 44
0
votes
0 answers

Combining plots and overlapping geom_rect objects using ggplot2 and cowplot

I am going to sum up some questions made before in this forum (1, 2), but in this case with my real datasets and codes, all together. I am stuck and need help to know to code it properly. Let's start with the datasets. Download and load them from…
antecessor
  • 2,688
  • 6
  • 29
  • 61
0
votes
0 answers

Flushing the png device in plot_grid (using cowplot)

Here is my problem: I do : plot_grid(first_graph_by_mistake) plot_grid(second_graph_on_purpuse) ggsave("graph1.png") vs ONLY plot_grid(second_graph_on_purpose) ggsave("graph2.png") both the graphs look the same but when I do: system("diff…
user2338823
  • 501
  • 1
  • 3
  • 16
0
votes
1 answer

Reduce white space margin in cowplot

Data and libraries used for this question: library(tidyverse) library(reshape2) library(cowplot) data("diamonds") temp1_m <- temp2_m <- melt(diamonds[1:3]) temp1_m[3] <- temp2_m[3] <- NULL colnames(temp1_m) <- colnames(temp2_m) <- c('Var1', 'Var2',…
Baraliuh
  • 593
  • 3
  • 12
1 2 3
18
19