Questions tagged [geom-hline]
The geom-hline tag has no usage guidance.
geom-hline
64
questions
1
vote
1
answer
25
views
Customization of plots created with the ale package
I started using the ale package that automatically generates ggplot objects from models. I would like to remove the labels "75%", "median" and "25%" that are ...
1
vote
1
answer
16
views
Order of items in an R graph legend are different depending on different datasets of the same data
Newish to R and Stack Overflow but I wrote some R code to make grouped boxplots for chlorophyll data by season and site while including a water quality criteria reference line. It may not be the most ...
1
vote
1
answer
55
views
pickerInput to show one or multiple geom_hlines that are different colors on plot
This is my app:
I'd like the user to be able to show the control mean for one or more categories, and for the line(s) to show as horizontal line(s) corresponding to the same category color as the bar(...
0
votes
2
answers
56
views
ggplot loop output messes up on hline
I wrote a loop in R that takes my dataframe of validation metrics and cycles through them, plotting the results using ggplot. However, geom_hline portion on the plot has weird shifting that I cannot ...
0
votes
1
answer
38
views
How to add individual pre-calculated h-lines to a plot in ggplot?
I've created a plot and need to add a threshold line to it:
BlinkRep <- ggplot(data = BlinkRes, aes(x = well, y = FluoCont, fill = Validity))+
geom_point(position = position_jitter(), shape = 21)...
0
votes
1
answer
44
views
How to add horizontal lines for different facets in ggplot2
I want to add horizontal line to a facetted barplot using ggplot2.
I have two nutrient types, each with a different guideline value I would like to display and I want the plots to appear side by side ...
1
vote
1
answer
65
views
add different geom_hline to different facet
I have the following code:
install.packages("tidyverse")
library("tidyverse")
data(diamonds)
ggplot(data=diamonds)+
geom_point(mapping=aes(x=carat,y=price),color="blue"...
0
votes
2
answers
132
views
Error: object 'i' not found in geom_hline and geom_vline
I want to make a scatter plot with a horizontal and a vertical line. The lines shall appear at the mean of the x and y variable. What I do is:
# Some data
df <- data.frame(x= rnorm(100), y= rnorm(...
1
vote
1
answer
2k
views
How to specify geom_hline color AND linetype in ggplot legend?
I'm using hlines to visualize screening level thresholds while displaying four categorical variables and one numeric variable. I want to display both a different linetypes AND color for each threshold ...
0
votes
1
answer
49
views
Error in split for mapply plotting of multiple plots
I am trying to split two dataframes to allow for production of multiple plots with mapply but cant get the outcome i need. I think it's got to do with the length of each split list being different but ...
0
votes
1
answer
81
views
Is there a way to add multiple horizontal lines to a plot with different symbology and a legent?
I need to add horizontal lines (similar to geom_hline) to a plot but retain the ability to add symbology (e.g. different dashed or dotted line) to each and have them appear in a legend. The y-...
1
vote
1
answer
44
views
Adding geom_hline with mean data using for loop
I have the following dataset and I managed to write a for loop code to plot the 13 different cytokines (analyte).
structure(list(studienr = c(1, 1, 1, 1, 1, 1), treat = structure(c(2L,
2L, 2L, 2L, 2L,...
1
vote
1
answer
899
views
How to add a label to horizontal line in ggplot 2 when x-axis is date?
I am trying to graph a temperature dataset using mean, max, and min temps by month over 2 years. The graph includes two horizontal temperature thresholds.
I have succeeded in creating a graph, but I ...
0
votes
1
answer
170
views
How to draw lines at each panel divided by facet_wrap() in R?
Here is one data
variety<- c("CV1","CV1")
trt<- c("N0","N1")
yield<- c(100,150)
dataA<- data.frame(variety,yield,trt)
and I made a graph using ...
0
votes
1
answer
65
views
Creating geom_hlines for two variables with two groups
I'm struggling to get 4 total geom_hlines on the following plot:
I want LDL cholesterol to have its own mean hline. Here's my code - any suggestions? I think it has to do with my errorbar but I can't ...