Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
110 views

I am trying to compose a figure with multiple panels. I have a lot of empty space and I am trying to overlap some of the rectangular panels, so I can make some of them larger. However, setting in ...
dkysh's user avatar
  • 91
0 votes
2 answers
73 views

I'm trying to recreate a stunning and often shared graphic "Where are Americans Born." It involves using facet_geo to display the percent of out-of-state and foreign born residents for each ...
TCD's user avatar
  • 11
0 votes
2 answers
96 views

I have 3 plots that I want to arrange in a 2x2 format. They all share the same legend, and I want to place the legend in the bottom right space, where a fourth figure would fit. So far, I have tried ...
Gabriel's user avatar
  • 81
-4 votes
1 answer
141 views

I would like to generate a few different plots in ggplot2 and assemble them in an image tool like MS publisher or Inkscape to get a single publication-ready figure. Ideally, I would like to produce ...
Cobalamin's user avatar
0 votes
2 answers
104 views

I'm visualizing ecological niche shifts by combining a scatter plot (scaled environmental values) with marginal density plots of the respective variables — similar to a marginal histogram layout. I am ...
Antony's user avatar
  • 1
1 vote
2 answers
111 views

I want to reproduce this graph: From the following paper: https://www.journals.uchicago.edu/doi/10.1086/730711 I have used facet wrap, but it does not have variable heights. Facet grid would not work ...
Victor Hartman's user avatar
1 vote
1 answer
67 views

I am trying to place the 5 graphs in a way that Three graphs comes on top row and 2 graphs in bottom row but the problem is the graphs at bottoms appear either on right or left side. I want to place ...
Muhammad Jawad's user avatar
6 votes
2 answers
289 views

When merging axis labels with the patchwork package, problems occurred (see this question). From the answer of the question, I applied the idea of the example code to my concrete example, in which I ...
Excelsior's user avatar
  • 287
1 vote
1 answer
141 views

I am trying to combine three plots, and I would like to have one plot on top and two in a second row one next to the other. All plots should have same height and width. I am using patchwork package. ...
kris's user avatar
  • 187
1 vote
1 answer
89 views

In the most straightforward case, the patchwork does a good job of pairing its two panels, but it also seems to ignore the subdiagram's specification of the location of the legend legend.box.spacing: ...
Breeze's user avatar
  • 586
1 vote
1 answer
51 views

I'm pretty new to R and so far have successfully managed to solve all issues I encountered using a combination of stackoverflow, manuals, Google and ChatGPT. So before I start I have to say a big ...
chodid's user avatar
  • 13
1 vote
1 answer
42 views

Preamble I have 2 plots in ggplot2 and want to put them in RMarkdown document. I'm mainly using grid.arrange to do that. But since those plots have completely different heights, I need to adjust using ...
isaid-hi's user avatar
  • 173
2 votes
1 answer
142 views

I'm trying to combine several plots using patchwork in R, but I'm encountering an issue with misalignment and inconsistent spacing between the panels. The first set of plots is drawn with double ...
Yeahhiam's user avatar
1 vote
1 answer
144 views

I need to create a plot layout with two main plots having an inset each. I'd like to keep the legend in the main plots (positioned inside the plot), but I need to show the insets without any legend. I ...
Giuseppe Petri's user avatar
1 vote
1 answer
61 views

I am attempting to place multiple graphs into one page using patchwork. I have the separate graphs as Group 1 and Group 2 with their 2 legends in each case. However, when I use patchwork to put them ...
Gabby's user avatar
  • 21
0 votes
0 answers
108 views

A new error message popped up with patchwork today in code that used to work. Here's a reproducible example: library(tidyverse) library(magrittr) library(patchwork) d1 <- tibble( x = rep(1, 5), ...
tomw's user avatar
  • 3,231
1 vote
1 answer
433 views

I tried to create a plot with shared axis-labels. The problem was, that I wanted my legend under my plots, because my plots otherwise would be too compressed. I didn't managed to creade a good plot ...
W B's user avatar
  • 11
0 votes
1 answer
79 views

A simple patchwork of ggplot has left me uncertain how to locate the legend in the overall figure. Here's the data and the two plots library(tidyverse) library(patchwork) library(magrittr) set.seed(...
tomw's user avatar
  • 3,231
2 votes
1 answer
273 views

I have two plots. The first one (big) is the one which should function as the "background plot". The second (small) should be the inset. How can i adjust the size of the inset? How to ...
geek45's user avatar
  • 723
3 votes
1 answer
508 views

I have a grouped bar plot (two conditions with two groups in each). I am not having trouble creating the group bar plots, but I am interested in putting individual data points on the plot and ...
Ryan Panela's user avatar
2 votes
1 answer
215 views

I am trying to only "collect" partial of legends with patchwork, below is a minimal example. library(patchwork) library(ggplot2) p1 <- ggplot(mtcars, aes(mpg, disp, color = factor(vs))) +...
yuw444's user avatar
  • 436
2 votes
2 answers
99 views

In this example, I added a border to the three plots: library(ggplot2) library(patchwork) theme_border <- theme_gray() + theme(plot.background = element_rect(fill = NA, colour = 'black', ...
Tianjian Qin's user avatar
1 vote
1 answer
360 views

I want to combine two charts prepared with Plotly and ggplot2 into one PDF. Below, you can see the code for the preparation of the charts: library(ggplot2) library(plotly) library(dplyr) library(...
silent_hunter's user avatar
0 votes
1 answer
299 views

I am having difficulty aligning my grid figure correctly when I have removed the repeating tick labels on the y-axis while combining other facet wraps with different length tick labels in patchwork. I ...
maRvin's user avatar
  • 375
0 votes
1 answer
174 views

When trying to add two ggplot objects (plots) using + from patchwork, I get the error as shown below. What could be the issue? require(patchwork) ex.df <- data.table( x1 = rnorm(1000, 20, 50), ...
B.M Njuguna's user avatar

1
2 3 4 5