Questions tagged [ggrepel]

ggrepel: Repulsive Text and Label Geoms for 'ggplot2' Provides text and label geoms for 'ggplot2' that help to avoid overlapping text labels. Labels repel away from each other and away from the data points.

Repulsive Text and Label Geoms for

Description

Provides text and label geoms for 'ggplot2' that help to avoid overlapping text labels. Labels repel away from each other and away from the data points.

Repositories

206 questions
2
votes
1 answer

How to stop ggrepel overlapping points using xlim or ylim

I am really struggling with what is probably a very simple bit of graphing. with the following code in R for my volcano plot: > vol+geom_label_repel(data = subset(data, color=="Increased"), aes(label=gene)) I get the following picture: However if…
reubenmcg
  • 371
  • 4
  • 18
2
votes
1 answer

ggplot: labelling geom_smooth / stat_smooth values at correct value

I'm trying to get labels to line up with the values from a smooth line. While other answers I've seen suggest creating a data column of predicted values, I'm looking for a cleaner alternative that uses the data that is already being produced for…
jzadra
  • 4,012
  • 2
  • 26
  • 46
2
votes
1 answer

Error in zero_range() when running ggrepel with Github version of ggplot2

I recently upgraded my R version to 3.2.3, and updated my packages. I then installed the Github version of ggplot2 and CRAN version of ggrepel. The versions for the packages in use are: ggplot2: 2.1.0.9000 ggrepel: 0.5 scales: 0.4.0 But after…
info_seekeR
  • 1,296
  • 1
  • 15
  • 33
1
vote
0 answers

How do I resolve the overlap in fviz_pca_biplot in factoextra packages

In the following command, whose shape output is also known, I have the problem of overlap in the specified area. I want all correlation lines to have labels without overlapping. I used the geom_label_repel command, but I got an…
1
vote
1 answer

how to use geom_label_repel with facet_wrap and geom_smooth?

My goal is to label each curve drawn with geom_smooth at the end of the curve but when I use facet_wrap, the labels are not placed correctly and does not always appear. This is my example…
Mmerose
  • 25
  • 5
1
vote
1 answer

how to avoid overlap text in result of PCA biplot

the below plot obtains from this script, but much of the text is overlapping, I want to be displayed separately. fviz_pca_biplot(res.pca, labelsize=3, addEllipses = T, repel=F, #…
rezgar
  • 114
  • 8
1
vote
1 answer

How do I fix these labels at the end of line?

I am using the ggrepel package to add labels to the end of lines in ggplot. I am having an issue where the labels are overlapping and adding more labels than needed. I adjusted my max.overlap value a few times and was still getting overlaps. My 2022…
Kevin
  • 39
  • 7
1
vote
1 answer

Labels in wrong positions on grouped bar chart in ggplot2?

I can't for the life of me figure out what's going on here. Here's the code: full_c_df |> ggplot() + aes( x = year_month, y = conversions, fill = series ) + geom_bar(stat = "identity", position = "dodge") + …
Christopher Penn
  • 539
  • 4
  • 14
1
vote
0 answers

I get an error every time I run geom_label_repel()

I'm trying to put the label for each line in the plot but some of the labels overlap enter image description here I read that geom_label_repel() is the best to use when labels overlap. however, when I try it, I get this error Error in…
Mona
  • 25
  • 3
1
vote
1 answer

Using plotmath with geom_label_repel to have subscripts within the labels

I am trying to have subscripts in my geom_label. e.g. Maine Apo (km/h) = 9 Qt (m/s) = 90 I am aware of using [x] to get subscripts but I am not sure how to achieve that when I want to get the label values (partly) from a column. I tried using…
M--
  • 25,431
  • 8
  • 61
  • 93
1
vote
1 answer

How to combine geom_map and geom_point in ggplot2

I am trying to combine geom_map and geom_point in ggplot2 using 2 data frames. When running the first part with geom_point only, I get the right plot. When running both combined geoms_ I get the error: "Don't know how to automatically pick scale…
1
vote
0 answers

Warning message prevents ggrepel from saving ggmap as image file

I'm trying to save a map with coordinates and labels (using ggrepel) as an image file. This is my code: library(ggplot2) library(ggmap) library(ggrepel) library(grid) lon = c(8.5213, 9.9576, 11.0621, 12.1844, 9.1307, 8.4090, 11.0549, 9.0997, …
AlexLee
  • 429
  • 4
  • 11
1
vote
1 answer

How can I manually add labels to multiple ggplot2 mappings created through a for-loop?

I have been working on plotting several lines according to different probability levels and am stuck adding labels to each line to represent the probability level. Since each curve plotted has varying x and y coordinates, I cannot simply have a…
1
vote
2 answers

How do I make ggrepel move (some) labels outside US map boundaries?

I'm trying to create my first map using ggrepel, but as you can see I've instead created a dumpster fire of overlapping labels. Most of the locations I'm mapping and labelling are clustered in the northeast, so the labels overlap. How do I get some…
RKeithL
  • 157
  • 1
  • 9
1
vote
1 answer

Make text labels span multiple ggplot facet grid panes

How can geom_text_repel() labels be made to span multiple facet_grid() panes? For instance, if there are many long labels that do not fit within the proper dimensions of each grid plot, the label should be positioned as if the facet_grid() were a…
zdebruine
  • 3,687
  • 6
  • 31
  • 50