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
0
votes
0 answers

Remove labels from graph using geom_label_repel

I have a plot as below You can reproduce the graph using this code: set.seed(42) d <- data.frame( x1 = 1, y1 = rnorm(10), x2 = 2, y2 = rnorm(10), lab = state.name[1:10] ) p <- ggplot(d, aes(x1, y1, xend = x2, yend = y2, label = lab, col…
NganKD
  • 71
  • 6
0
votes
0 answers

Is there a way to subset data in ggrepel with data inherited from the pipe?

I am plotting data using dplyr, ggplot2, and ggrepel. I would like to use ggrepel to only label certain points in my dataset. I usually accomplish this by subsetting the data within the geom_text_repel() layer, but I have not found a way to make…
0
votes
1 answer

How to label lines obtained using split with ggrepel

I am trying to label 4 lines grouped by the value of variable cc. To label the lines I use ggrepel but I get all the 4 labels instead of 2 for each graph. How to correct this error? The location of the labels is in this example at the last date but…
sbac
  • 1,897
  • 1
  • 18
  • 31
0
votes
0 answers

R ggplot2 ggrepel labelling positions

I am trying to add labels to a ggplot object. The labels do not look neat and tidy due to their positioning. I have tried using various geom_label_repel and geom_text_repel options but am not having much luck. I cannot share the data unfortunately,…
LauraC
  • 55
  • 1
  • 7
0
votes
2 answers

ggplot2 + ggrepel adding legend with label colours changes the colours itself

Assume the following data: library(tidyverse) library(ggrepel) df <- data.frame(name = rep(letters[1:3], 3), points = c(5, 3, 7, 12, 13, 14, 20, 30, 40), time = rep(c("day 1", "day 2", "day 3"), each = 3)) df2 <-…
deschen
  • 10,012
  • 3
  • 27
  • 50
0
votes
1 answer

Show all labels with fviz_clust

i have a question concerning hirarchical clustering with factoextra fviz_clust(), so actually ggplot2 i guess. In my Factor map the labels look like this but i want to have it, that way more labels are shown, especially in cluster one. I know there…
CoDa
  • 132
  • 10
0
votes
1 answer

How can I repel the label name from the plot in ggplot2

I have a boxplot graph where I want to show label names. The problem is that I want to repel these label names to make them beyond the boxplot. I tried geom_text_repel from ggrepel package but it repels lables when they overlap each other. Also…
rg4s
  • 811
  • 5
  • 22
0
votes
0 answers

Is there a way to make sure that the labels on my graph dont overlap with each other other than ggrepel as that seems to run forever

I'm trying to make sure that the district labels don't overlap on my graph as they are kinda congested and too many. However, using geom_text_repel produces no results even when I let it run for hours. Please help me out I have been stuck on this…
0
votes
1 answer

How to use ggrepel to place data labels

First is the sample data and some manipulations A<- c(150,125,0,-300,-350,-370) Series<- c("Construction","Manufacturing","Information","Health_Care","Education","Government") testdf <- data.frame(A,Series) …
Tim Wilcox
  • 1,275
  • 2
  • 19
  • 43
0
votes
0 answers

R - Annotate a map with inset plots/graphs?

Using R, I'd like to display inset plots/graphs on a map that show profiles for specific places on the map and lines that points from the graph to the point on the map like in ggrepel but with plots instead of labels. I was thinking of using…
Arthur Yip
  • 5,810
  • 2
  • 31
  • 50
0
votes
0 answers

ggnet network avoid overlapping labels

I am plotting a network using ggnet in R ggnet2(net2, label = F, palette = col, alpha = 0.75, size = 4, edge.alpha = 0.5, label.size = 2, node.color = "category") This works fine but the labels are on top of each other. Since I do not want all…
0
votes
1 answer

Place labels above and below interspersed

I am using ggrepel to add labels to my ggplot graph. To better use the space in the plot I want to add one label above an "upper_value" and the following below the "bottom_value" along the x-axis, interspersed. The problem is that the bottom labels…
Sergio.pv
  • 1,380
  • 4
  • 14
  • 23
0
votes
1 answer

using geom_text_repel to customize labels where displaying at the end of lines

In the plot below, I was wondering to know how can I customize the labels (state names) to reduce the gap between the labels? Here is part of my code that I believe needs to be modified. ggrepel::geom_text_repel(aes(x =Year+1.6, y =…
Nader Mehri
  • 514
  • 1
  • 5
  • 21
0
votes
1 answer

Combine text and image in a geom_label_repel in ggplot

I'm trying to do a line graph and have the last point of each series be labelled by a combination of text and image. I usually use ggrepel package for this and have no problem doing this with text only. My problem is I can't figure out how to add an…
MonkeyBack
  • 61
  • 6
0
votes
2 answers

Color legend with geom_text_repel and geom_point

how can be colored the dots next to the legend labels? scale_color_manual or scale_fill_manual do not work. Also how can I change the dots in the legend to squares? Thanks set.seed(1) library(ggplot2) library(ggrepel) df <-…