geom-text Questions
1
Solved
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, w...
1
How can I avoid that these 2 layers in ggplot2 overlap? I try to display the text so that they are not laying above the points.
check_overlap does a great job with avoiding that the text overlaps ...
Underexpose asked 4/10, 2017 at 0:39
1
Solved
I'd like to visualize a data using bar chart and ggplot.
I have the data below, when I want to vis this data the text for negative values are not showing below the Bar .
dat <- read.table(te...
1
Solved
ggplot2 automatically centers the text in a geom_text layer. For example:
library(ggplot2)
library(tidyverse)
df <- data_frame(text = c("A short sentence.",
"A slightly longer sentence.",
"Th...
2
Solved
I have successfully made a stacked barplot in R where the percentages add up to 100% for several different categories. I made an example dataframe here.
example.Category<- c("Cat1","Cat2","Cat3...
0
I can get ggplot to print Japanese Unicode characters in axis labels and legends, but not in labels. Is this a bug?
library(extrafont)
library(ggplot2)
data_frame <- cbind.data.frame("number"=c...
2
Solved
I have a dataset where I am interested in looking at a score on a test and the percentage of people experiencing an event:
dat <- data.frame(score = 1:7,
n.event = c(263,5177,3599,21399,16228,...
Sanders asked 14/4, 2017 at 16:8
1
Solved
I am generating some basic bar plots in ggplot2 using geom_bar. I would like the number to be listed in the same color above each bar and I am using geom_text. I am filling the bars by using scale_...
1
Solved
I would like to position the corresponding value labels in a geom_col stacked barchart in the middle of each bar segment.
However, my naive attempt fails.
library(ggplot2) # Version: ggplo...
Radiocarbon asked 21/11, 2016 at 15:51
2
Solved
I would like to adjust the text on the barplot.
I tried to adjust hjust/vjust to display as I like it but it seems like it's not working properly.
ggplot(data) +
geom_bar(aes(name, count,
fil...
2
Solved
I'm looking for a way to label a stacked bar chart with percentages while the y-axis shows the original count (using ggplot). Here is a MWE for the plot without labels:
library(ggplot2)
df <- a...
2
Solved
This is actually two questions in one (not sure if goes against SO rules, but anyway).
First question is how can I force a geom_text to fit within a geom_bar? (dynamically according to the values ...
2
Solved
I need to show the results of a clustering. For demo, please see
library(ggplot2)
df = data.frame(cluster=c(1,1,2,2,2,3),states=c("AB","IN","UN","CH","LO","OK"))
p2<-ggplot(df,aes(x=1,y=states,...
1
Solved
I have a bar plot with a facet grid, and I would like to add the number of observations per sub-plot which are stored in a separate dataframe.
The bar plot is produced with
bar.plot <- ggplot(...
1
Solved
I want to plot frequency distribution of an [r] factor variable as a bargraph, where bars represent the frequency counts of the factor levels. I use ggplot2 to do that and there's no problem ...
1
Solved
I am wondering how i can put after decimal zero in the faceted ggplot plot. Following picture make it more clear. I would like to write r-squared =0.61 and 0.30 in two facets of ggplot using geom_t...
1
Solved
I'm plotting a stacked bar graph and use geom_text to insert the value of each stack. The difficulty I'm facing is that some stacks are very small/narrow, so that the text of two stacks overlap eac...
© 2022 - 2025 — McMap. All rights reserved.