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
5
votes
2 answers

shrink plot width to make more room for ggrepel labels

I want to shrink the plot area so there is more room for ggrepel labels that currently get cut off. I can't seem to offset the labels any more via nudge_x(), and I do not want to shrink the text size. I'm trying to find a way to compress the chart…
Eric Green
  • 7,385
  • 11
  • 56
  • 102
5
votes
1 answer

ggrepel: using position_dodge in combination with geom_label_repel

I'm trying to label the outliers in a geom_boxplot using ggrepel::geom_label_repel. It works nicely when there's only one grouping variable, but when I try it for multiple grouping variables I run into a problem. The position argument in ggrepel…
Ravi
  • 81
  • 5
5
votes
1 answer

Adding text annotation to a clustering scatter plot (tSNE)

I have XY data (a 2D tSNE embedding of high dimensional data) which I'd like to scatter plot. The data are assigned to several clusters, so I'd like to color code the points by cluster and then add a single label for each cluster, that has the same…
dan
  • 6,048
  • 10
  • 57
  • 125
5
votes
0 answers

Trying to build a hook into plotly for ggrepel (geom_text_repel)

The link below talks about how you can build a hook into plotly using the gets3methods call with to.basic. However, this only works for geoms that that be broken down into simpler geoms (geom_line to geom_path). For geom_text_repel I'm not sure that…
Ted Mosby
  • 1,426
  • 1
  • 16
  • 41
5
votes
1 answer

Text repel with a position argument in ggplot/R

I am trying to make a geom_point where the text labels both repel, and point to their associated points even if I am using position=dodge or position=jitter. I also have a lot of points to label, which is why I want to use ggrepel or something…
Stonecraft
  • 860
  • 1
  • 12
  • 30
5
votes
1 answer

Using ggrepel with single plot point/adding line between label and point

Ok so I have a data set with 2 variables X and Y, and an ID variable. I've created a full plot using this code: ggplot(data = X_Y) + geom_point(mapping = aes(x = X, y = Y))+ geom_text_repel(mapping = aes(x = X, y = Y, label = ID))+ …
Gerard
  • 159
  • 1
  • 2
  • 11
4
votes
1 answer

How to display two categorical variables on one tile of a heatmap - triangle tiles

I have a dataset similar to the below example df <- structure(list(Species = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L,3L, 1L, 2L, 3L), .Label = c("setosa", "versicolor", "virginica"), class = "factor"), flower_att = c("Sepal.Length",…
AudileF
  • 436
  • 2
  • 10
4
votes
1 answer

how to control the color of ggrepel segments

Going to try this again with a better MRE...for context, here's the product I'm currently trying to improve What I'm trying to do is get the lines from the endpoints to the labels to be the same color as the data lines. For purposes of this…
jerH
  • 1,085
  • 1
  • 12
  • 30
4
votes
1 answer

Using ggrepel in ggplot2

I have a geom_gene_arrow plot and I need to use ggrepel to prevent labels from overlapping. Unfortunately, I haven't been able to get it to work and get and error saying 'could not find function "geom_text_repel"' Working example with only…
Lauren
  • 77
  • 1
  • 6
4
votes
0 answers

Make edges point to repelled labels in ggraph

I am creating a graph using the ggraph R package. I want to label all the nodes using geom_node_label(), but this often create overlaps. One way to fix is this is to use the repel=TRUE argument. Unfortunately I cant seem to figure out how to also…
user1593755
  • 141
  • 2
4
votes
2 answers

ggrepel labels outside (to the right) of ggplot area

library(tidyverse) library(ggrepel) df <- structure(list(Fruit = c("Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear",…
Display name
  • 4,153
  • 5
  • 27
  • 75
4
votes
1 answer

label geom_step series (group), but not all points

How can I label each geom_step series (group) without labeling each point? Here is the plot to label: Here's what I get with ggrepel: ex <- structure(list(date = structure(c(17643, 17650, 17657, 17664, …
Eric Green
  • 7,385
  • 11
  • 56
  • 102
4
votes
0 answers

How to show an image instead a text like a label with ggplot2 and R?

I have created a graphic with ggplot2 and I would like to know if its possible to put an image and how instead of a label using ggplot2. My code: ggplot(data, aes(x=DRTG, y=ORTG)) + geom_point(colour = "#000000") + ggtitle("Gráfico Liga DIA:…
José Carlos
  • 2,850
  • 12
  • 59
  • 95
4
votes
1 answer

Getting coordinates for the label locations from ggrepel

Below is an example of "label location optimization" using ggplot2 and ggrepel: x = c(0.8846, 1.1554, 0.9317, 0.9703, 0.9053, 0.9454, 1.0146, 0.9012, 0.9055, 1.3307) y = c(0.9828, 1.0329, 0.931, 1.3794, 0.9273, 0.9605, 1.0259, 0.9542, 0.9717,…
user3245256
  • 1,842
  • 4
  • 24
  • 51
4
votes
1 answer

pylab: plotting points with colors and labels (IDs, not categories)

I'm trying to plot points with both colors and labels. This is not a classical problem: in fact, typically python users set "labels" as categories. In this case I want that the color represents a feature, while the label is an identifier for the…
Andrea Ianni
  • 829
  • 12
  • 24
1 2
3
13 14