Questions tagged [geom-hline]
59 questions
0
votes
1 answer
assigning geom_hline value based on filtered data, and doing this as part of the same code chunk?
I'm trying assign geom_hline based on filtered data and selection of value from one column, but doing this all within the same code chunk. I am not sure what the best way is go about it - any help would be much appreciated.
sample…

dnmc
- 107
- 8
0
votes
0 answers
Change Linetype of geom_hline Without Changing the Legend Title
I am pretty new to R so please excuse me if I got this wrong.
I am trying to change a dashed linetype of a geom_hline in ggplot2 to a solid one.
Any help is much appreciated!
Usually this is easily done with changing linetype = "dashed" to linetype…

Tassio
- 1
0
votes
0 answers
Labeling geom_hline() with value and title
I am using ggplot2 to make a statistical control chart. I'm unaware if there is a way to do this in r without ggplot (there probably is), but I'm far enough into my code where I think I can finish the job with one fix.
I have the chart created with…

rm1512
- 11
- 6
0
votes
0 answers
Creating mean lines for each individual bar of a bar plot in shiny
I am trying to create a barplot using ggplot2 in shiny that has lines representing the mean for each of the bars. In other words, there will be 5 different mean lines (that are based on the data within the 5 separate bars of the plot). Is it…

Monty-PYTHON
- 13
- 1
- 7
0
votes
0 answers
Shortening mean line in two level factor within facet panels
I have a factor of time that has two levels, admission and discharge. I'm using facet_grid to create four panels in which my continuous Y will be looked at by time. I want to be able to add a mean line to each of the two time levels in each panel.…

Mircea_cel_Batran
- 95
- 2
- 10
0
votes
1 answer
Can't add different lines to different facets in geom_bar()
I'm trying to add different lines to different facets in geom_bar() in ggplot. I'm able to replicate solutions posted here but can't get mine to work. Help greatly appreciated!
Here is my database:
> rbind(head(mlt1), tail(mlt1))
Group…

Tomasge
- 11
- 2
0
votes
0 answers
How to add the mean of data as a horizontal line on a faceted plot in r ggplot2
I am trying to add the mean of Duration Average column in a faceted plot. Somehow I can get around it, I tried some functions such as geom_hline, but somehow it is not working on a faceted chart:
added this block to the chart, but it did not…

Ibo
- 4,081
- 6
- 45
- 65
0
votes
0 answers
R: ggplot geom_hline custom legend with scale_color_manual error
My code was working fine until I added another geom_hline() layer to my plot. Now I keep getting this error and I don't understand what I'm doing wrong. I want to have two horizontal lines both red but one either dotted or dashed at the yintercept…

NBE
- 641
- 2
- 11
- 33
0
votes
1 answer
Label hline in facetwrap ggplot2
I am trying to label the hline in my ggplot with it's value for each facet.The facet_wrap displays several Ratings, and the hline values come from the Benchmark.
I have tried using label= within the geom_hline but that does not work. I would…

Christian
- 3
- 1
0
votes
0 answers
Attempting to add mean line to facet_wrap plot with additional grouping variable
I'm attempting to make a scatterplot with ggplot. My data set is made up for 4 columns, three of which are factor variables and the fourth is a continuous variable.
'data.frame': 108 obs. of 4 variables:
$ Name : Factor w/ 3 levels…

Mircea_cel_Batran
- 95
- 2
- 10
0
votes
1 answer
Looping through columns with ggplot and modyfing geom_hline(yintercept) accordingly
This is an incremental question that refers directly to this topic:
How do I loop through column names and make a ggplot scatteplot for each one
I would like to loop through column names and make a ggplot scatteplot for each one, but I want add…

Yaahtzeck
- 217
- 2
- 13
0
votes
1 answer
Error bar on hline in ggolot
I have a slighlty complex looking plot, created with ggplot2; with X axis having names of each point and Y axis having their values. I used geom_point to represent these. I have also added errorbars for each point on the plot.
Now I have…

Syamanthaka
- 1,227
- 2
- 15
- 23
-1
votes
1 answer
R geom_hline only showing solid lines
I have some plots I'm doing up with ggplot2, using a function for the basic plot then adding some elements. I have an issue with one involving adding a geom_hline, but where it works for other plots, this one doesn't seem to want to show the line as…

EMCA
- 1
-2
votes
1 answer
Shiny, R: Check box, geom_hline, ggplot
in my shiny app, I would like to add a geom_hline in my ggplot only when the user selects to do so with a checkbox, also I would like the user to set the yintercept with a numericInput.
I believe that there is an easy solution but as I am not a…

MBl
- 35
- 8