Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

I have a patchwork plot consisting of a total of four plots. The procedure I’m asking about is mainly relevant for two of them, though I believe it can be applied to both. These two plots share a ...
Felix's user avatar
  • 41
0 votes
2 answers
78 views

I have a ggplot2 plot with both positive and negative geom_bar values. For the geom_bar that shows the negative values, I’m having an issue where the position of geom_text is not displayed correctly. ...
Felix's user avatar
  • 41
1 vote
1 answer
90 views

I am building a pie chart in ggplot using geom_bar and coord_polar and having problems with positionning the labels with geom_text. Ggplot seams to change the order of the classes and put the labels ...
Vitor Hugo Moreau's user avatar
2 votes
1 answer
90 views

I'm trying to replicate the spiral example for geom_textpath() shown at the top here: https://allancameron.github.io/geomtextpath/ My y-axis is numeric, so that part works out fine, but my x-axis is a ...
user25090379's user avatar
0 votes
1 answer
69 views

I'm working on a plot showing the length distribution of some events in the human genome. I'm pretty OK with the end result but wish to add a geom_label for the highest count reporting the ...
Matteo's user avatar
  • 435
3 votes
3 answers
199 views

I want to build a tiff file with text only and no margins around the text, using R. I tried : library(ggplot2) plt <- ggplot() + geom_text(aes(x=0,y=0,label="test")) + theme_void() ...
Jean-Luc Dupouey's user avatar
1 vote
1 answer
187 views

I've read this solution: But it is Windows specific so it didn't work for me. Is there another solution? I've loaded my font like this: install.packages("showtext") library(showtext) ...
Caterina's user avatar
  • 1,117
1 vote
1 answer
133 views

I am creating a tertiary plot in a shiny app and the points are in different parts of the plot depending on the selected sites. The labels need to repel when points are overlapping or land on the axis....
Kerry Kuntz's user avatar
3 votes
0 answers
79 views

I get this R ggplot2 working graph: library("xkcd") library("extrafont") library("ggplot2") library("gridExtra") X <- c(0,20) prova_A <- 0 + 5*X ...
VICTOR M S DELGADO's user avatar
-1 votes
1 answer
1k views

I am having trouble showing the points of interest on my ggplot. When I select for my genes in geom_label_repel() i only get 3 that appear when i know that there are 57 that show up in the list. fig1. ...
phampe's user avatar
  • 1
3 votes
1 answer
119 views

I have a dummy dataset: tmp <- structure(list(order = c("John", "John", "John", "Ross", "Ross", "Ross", "John", "John&...
LT17's user avatar
  • 351
0 votes
1 answer
126 views

I have 2 plots that I'm joining together. The top shows the raw data and the second is a subjective rating. The issue is that when I try to have a label using annotate() with rich text explaining what ...
J.Sabree's user avatar
  • 2,596
1 vote
0 answers
46 views

I have prepared a map of the UK using giscoR and have successfully added location points to the map using latitude and longitude and ggplot2. I now want to add labels to these points but when I ...
Jonathan Holmes's user avatar
2 votes
1 answer
94 views

I have a 6-facet ggplot2 bar chart. I want each facet to be annotated with its respective mean value. Like this: x̄ = 0.25 So I have been trying: geom_text (data = averages, inherit.aes = FALSE, ...
ginn's user avatar
  • 175
0 votes
1 answer
136 views

I am adding flow percentages in my ggalluvial plot based on an existing StackOverflow case (how to calculate percentages in geom_flow() based on variable size and not stratum size) which works fine. ...
joejoe9's user avatar
  • 107
1 vote
1 answer
71 views

In pacakage GGally ggparcoord, I want add labels to the plot, but geom_text failed, how to fix it ? Thanks! library(GGally) library(tidyverse) data <- iris Create basic plot plot_basic ...
anderwyang's user avatar
  • 2,547
0 votes
1 answer
65 views

I'm attempting to use geom_text to create a label 'Ankle Absorption W = -0.52 - 0.13 x Hop Height'. My understanding is that I need to use %*% within expression() to output the x sign. The numbers are ...
D.O.'s user avatar
  • 3
1 vote
1 answer
184 views

In the following ggplot in r, I would like my "n" labels to be aligned with the left side of each bar — as they are on the pink bars but not on the blue bars. Somehow, the dodging is not ...
Noa Perlmutter's user avatar
1 vote
3 answers
61 views

I am plotting the publication of scientific papers on a specific research topic on a timeline. I would like to add author and year to the corresponding rectangles using the "label" variable. ...
Milena's user avatar
  • 13
1 vote
1 answer
34 views

I'm trying to add values at the top of my bars of a barchart with two groups. It works fine for values above zero. But I have also levels where there were no counts, so bars with the hight of 0. Then ...
Hildrun Walter's user avatar
0 votes
1 answer
69 views

I'm trying to use RStudio and ggplot2. I have a list of studies, some information about their data and another couple of columns of numbers. What I would like is a plot where I could fix the size of ...
Simon Turner's user avatar
0 votes
1 answer
61 views

I have created a divergent bar plot, and after the plot is created I want to add several symbols in order to indicate some information about then as a footnote. I provide the code to create the object ...
Javier Hernando's user avatar
-1 votes
1 answer
35 views

I have a dataset in R that looks like this: With the following code I get the graph below: ggplot(subset(f,!is.na(d)),aes(x=d,y=(..count..)/sum(..count..),fill=forcats::fct_rev(e))) + geom_bar(...
Mike Wang's user avatar
0 votes
1 answer
70 views

I am trying to add a unique label to each faceted panel in my plots. Below is the code which I annotated and will describe in detail below: ebird <- left_join(ebird, cor, by = ...
Nick's user avatar
  • 175
0 votes
1 answer
44 views

When producing a stacked bar graph that has different color by facet variable and bar fill variable, I would like to add the number/count by each color. I am using the geom_text function by it seems ...
enat_b's user avatar
  • 30
0 votes
0 answers
25 views

I've created pie charts using geom_bar() and coord_polar(). Finally, I've got my graph as I wanted it besides of this: There occurs an letter (a small "a") in my legend boxes and I don't ...
Hildrun Walter's user avatar
0 votes
1 answer
52 views

I'm having some trouble with the geom_text combined in facet_wrap function in RStudio. I wanted to insert the R^2 of each function in each graph created with the ggplot2 library. I've summyrised the R^...
Andrea Pagliai's user avatar
0 votes
1 answer
48 views

In ggfittext::geom_fit_text , it seems can't use vjust . Below amount and value are override . Anyone can help on this ? Thanks library(tidyverse) library(ggfittext) diamonds %>% group_by(color,...
anderwyang's user avatar
  • 2,547
0 votes
1 answer
49 views

I have the following common scenario: I have climate data observations and predicitons for a certain point. To evaluate the model performance the data gets plotted in a line plot and the metrics ...
talocodat's user avatar
0 votes
1 answer
149 views

MWE: library(metR) heat_palette = c("darkred", "red", "yellow", "#00A600", "darkgreen") heatmap_of_percentage <- function(percent) { # display &...
Mohan's user avatar
  • 9,223
0 votes
0 answers
34 views

I want the x-axis label to set the color according to the ONTOLOGY classification, but axis.text cannot complete such an operation, so I hide the original x-axis label and use geom_text() to add the ...
Jian Rao's user avatar
1 vote
1 answer
181 views

I'm trying to make a forest plot using some data: dt <- data.frame(outcome = c("A", "B", "C", "D"), beta = c(-0.007, -0.008, -0.009, -0.009)...
Yannick's user avatar
  • 23
0 votes
2 answers
69 views

I have this app, that should show the p-values stars above the columns or confidence intervals if selected. It works for one category, not another (only two of the four categories apply). How can I ...
hks's user avatar
  • 179
2 votes
2 answers
295 views

I have found a problem when plotting hex graphs using ggplot2. When I use geom_text to add text to the graph, it takes a very long time! I made a minimal, self-contained, reproducible example and you ...
Geoffery's user avatar
1 vote
1 answer
236 views

This question uses the public data and code from another question I am trying to add labels to my map. When I use geom_text, each label correctly appears once but collided (right side). To avoid ...
ithoughtso's user avatar
4 votes
2 answers
176 views

I have the following dataframe df: df <- structure(list(ID = c(1, 1, 2, 2, 3, 3, 4, 4), Group = c("A", "B", "A", "B", "A", "B", "B&...
benson23's user avatar
  • 19.6k
2 votes
1 answer
183 views

The graphic generated by the code below is updated on a regular basis, and it has been working ok every time, but with the addition of a new data for "Japan", the label is sitting neither ...
pixel9's user avatar
  • 39
3 votes
1 answer
57 views

Numbers are top justified with parentheses in geom_label_repel() (Example with code below). The same behavior occurs when using geom_label(). How can I get the numbers in the labels to be in the ...
U. Mena's user avatar
  • 51
1 vote
1 answer
41 views

I'm trying to display a single value in my ggplot, but from a different data frame than the rest of the plot data. Basically, I just want to insert "d = [value from second dataframe]" in a ...
wythe4's user avatar
  • 139
2 votes
1 answer
413 views

I am trying to create a stacked bar chart with percentages in R. The problem that I have is that some of the labels are overlapping in the bar (see the two 3%-labels in the bar at the bottom position):...
Christina's user avatar
1 vote
1 answer
82 views

Here is my fake data: dat1 <- structure(list(A_B = c("A", "B", "A", "B", "A", "B", "A", "B", "A", "B&...
TarJae's user avatar
  • 80.2k
1 vote
1 answer
51 views

Consider this data: # A tibble: 15 x 3 group variable value <int> <fct> <int> 1 1 1 0 2 1 2 0 3 1 3 -2 4 2 1 1 ...
HoelR's user avatar
  • 6,877
1 vote
1 answer
205 views

I am attempting to make a bar graph in ggplot2 but when I add labels, they cluster over one middle bar rather than sitting on the bar the value itself represents. The code I am using: synch<-data....
Ducky's user avatar
  • 15
1 vote
2 answers
78 views

Is there a way to have this plot squeezed a little so labels of extreme cases (A and G) have could show up completely. code: x <- LETTERS[1:11] y <- c(9, 4, 6, 8, 5, 7, -9, -4, -6, -8, -5) z &...
rez's user avatar
  • 348
-1 votes
1 answer
59 views

I tried to create boxplot for each date. But they were not distributed by date. Instead, the data for all dates were gathered together. Here is the original data: df<-structure(list(traitement = c(&...
Nightowl's user avatar
  • 101
0 votes
1 answer
242 views

Could anyone help me figure out how to: Use geom_text to show labels only for those down and up categories (how to remove stable labels) How to manually change negative labels to positive ones (erase ...
rez's user avatar
  • 348
3 votes
2 answers
192 views

Here is a reproducible example: library(ggplot2) library(ggbeeswarm) ggplot(mtcars, aes(x = factor(am), y = mpg, color = factor(am))) + geom_quasirandom(pch = 15, size= 6, alpha=0.7) + geom_text(...
TarJae's user avatar
  • 80.2k
0 votes
1 answer
46 views

For one of the past weeks' TidyTuesday challenges, I tried to plot the US House Elections results. Here is the code; library(tidyverse) library(showtext) library(showtextdb) library(geofacet) library(...
mzkrc's user avatar
  • 419
1 vote
1 answer
270 views

I use facet_rep_grid to visualize different variables over the same x-axis. Now I would like to label the top left of each facet with "A", "B", "C" etc. what i have looks ...
Becci's user avatar
  • 57
0 votes
1 answer
92 views

I created a decent-looking figure in ggplot... pollinators_1 <- ggplot(data = pollinator_counts_hybrids, aes(x = pollinator.species, y = n, fill = taxa.visited)) + geom_bar(stat = '...
Melissa Duda's user avatar

1
2 3 4 5
13