Questions tagged [ggpubr]

An R package to prepare publication ready plots based on the ggplot2 plotting system.

532 questions
17
votes
1 answer

Add main title multiple plots ggarange

I have one data frame dt with data about dive behavior and at three different areas BA, MI, FA. I want to add main title to my multiple plots (ba, mi, fa) using ggarrange, but I didn't find something that worked. I want to add main title "Dive…
10
votes
1 answer

Customization of pointshape within function fviz_pca from FactoExtra package

I have been struggling to make a change on the default point shape that comes in the output plot within the function fviz_pca from the R package FactoExtra. The plot appears with a certain order* of point shapes which I want to customize. *The…
10
votes
1 answer

Combining a map and a XY ggplot chart in R

I need to combine a map, which represents an archaeological site, with an XY ggplot chart of different archaeological objects. The map is in a tiff file and must respect its proportion. First, this is the map, highlighting the reference scales in…
antecessor
  • 2,688
  • 6
  • 29
  • 61
9
votes
3 answers

How to add R2 for each facet of ggplot in R?

Is there a way to first change the facet label from 1:3 to something like c(good, bad, ugly). Also, i would like to add R2 value to each of the facet. Below is my code- i tried a few things but didn't succeed. DF = data.frame(SUB = rep(1:3, each =…
Hydro
  • 1,057
  • 12
  • 25
9
votes
1 answer

How To Edit Common Legend Title In ggarrange?

How do I edit a common legend title (make it bold font and enlarge the font size) using ggarrange? Based on the six plots I have (p1 to p6), I thought the following would work: p6 <- p6 + theme(legend.title = element_text(size = 15, face =…
shsh
  • 684
  • 1
  • 7
  • 18
8
votes
1 answer

ggarrange in for loop and multiple pages in pdf

Here is my issue: I am looping around my data. For each iteration of the loop, I create 3 plots that I organize on the same page, and I want to have one page per iteration stored in the same pdf file. I am using ggarrange from the ggpubr package (I…
sargg
  • 323
  • 3
  • 8
7
votes
1 answer

How to add math/subscript in geom_bracket in ggplot2?

I there! I want to include a label with subscript in geom_bracket in ggplot2. I tried in different ways, but no one worked (attempts in the comments): library(ggplot2) ggplot(data = mtcars, aes(x = vs, y = disp)) + geom_point() + …
7
votes
2 answers

add row and column titles with ggarrange

I have a list of ggplots that may be too complex to arrange using facet_wrap. All plots must share the same legend and should be arranged in a grid. Each column of the grid needs a different title, also each row of the grid needs a differen…
Darío Rocha
  • 140
  • 1
  • 5
7
votes
2 answers

ggpubr not creating multiple bars in ggdotchart

Utilizing the example package code in ggpubr, the ggdotchart function does not create separate segments as is shown in the example, instead there is only a single segment, though the dots seem to be placed in the correct orientation. Does anyone…
Jenks
  • 1,950
  • 3
  • 20
  • 27
7
votes
1 answer

ggpubr: change font size of stat_compare_means Kruskal-Wallis p-values

How can I change the font size of stat_compare_means on the plot below? I.e, change the "Kruskal-Wallis, p = 1.5e-09" and the other p-values font size? I would like to use a smaller font size than the default one... Following the data…
guidebortoli
  • 659
  • 3
  • 8
  • 16
6
votes
1 answer

How do I reduce the gaps between plots using ggarrange in R?

I am trying to create a waffle plot with a total of 9 plots in one. However, no matter what I try, I am not able to reduce the spacing between the 3 columns in the plot. This is the plot I have now. Wafle plot football The code I used so far goes…
Harsh Krishna
  • 83
  • 1
  • 4
6
votes
1 answer

I'm using stat_regline_equation with ggscatter. Is there a way to specify the significant digits of coefficients?

I've found using stat_regline_equation (with ggscatter) to be really useful for quickly adding regression equations to plots, especially when I having multiple regressions on multiple facets. However, it seems to be stuck on 2 significant figures…
Carl
  • 83
  • 1
  • 7
6
votes
3 answers

Can we neatly align the regression equation and R2 and p value?

What is the best (easiest) approach to add neatly to a ggplot plot the regression equation, the R2, and the p-value (for the equation)? Ideally it should be compatible with groups and faceting. This first plot with has the regression equation plus…
Mark Neal
  • 996
  • 16
  • 52
6
votes
0 answers

How to set plot size in ggplot or ggarrange?

I work with Rmarkdown and I am creating many figures composed of different ggplot2 charts, using ggarrange. The problem is that I am not able to set different sizes for figures inside a single chunk. The only way I managed to set figure size is…
LuizZ
  • 945
  • 2
  • 11
  • 23
6
votes
4 answers

Lay out multiple ggplot graphs on a page

I generate a list of ggplot objects inside a loop as follows: myPlots = list() for(i in 1:length(maturities)){ myPlots[[i]] <- ggplot(deltaIR.df, aes(sample = deltaIR.df[,i])) + stat_qq() + stat_qq_line() + …
Thomas Philips
  • 935
  • 2
  • 11
  • 22
1
2 3
35 36