Questions tagged [geom-area]
47 questions
0
votes
1 answer
R GGplot geom_area data perhaps unintentionally overlapping
I am working on the Tidy Tuesday data this week and ran into my geom_area doing what I think is overlapping the data. If I facet_wrap the data then there are no missing values in any year, but as soon as I make an area plot and fill it the…

Indescribled
- 320
- 1
- 10
0
votes
0 answers
geom_area with datetime variable
I understand that there is how to plot datetime variables with geom_area. I tried to convert first to a factor, then to a numeric, however i got this error every time:
Warning message:
In max(ids, na.rm = TRUE) : no non-missing arguments to max;…
0
votes
1 answer
geom_area not showing intended result when plotting data with multiple levels
R: I have found that when trying to plot an overlay of a histogram with geom_area, the result of individual overlays isn't consistent with when they are plotted together. Case in point:
#Make data
set.seed(1234)
df <- data.frame(
…

JREN_OP
- 79
- 2
0
votes
2 answers
Fill area between axis and plot fill area (ggplot2)
I am using this code:
library(tidyverse)
set.seed(143)
series <- data.frame(
time = c(rep(2017, 4),rep(2018, 4), rep(2019, 4), rep(2020, 4)),
type = rep(c('a', 'b', 'c', 'd'), 4),
value = rpois(16, 10)
)
plot1 <- ggplot(series,…

Sylvia Rodriguez
- 1,203
- 2
- 11
- 30
0
votes
0 answers
Remove border around geom_area in ggplot
The code below produces the image below. How can the code be modified to make the plot not have the grey space just outside of the colored groups? In some sense, I want the color part of the image to be touching the white around the image.
#import…

user551504
- 113
- 4
0
votes
0 answers
patterns and textures with ggplot2 geom_area
I have a short question regarding ggplot2. Is it possible to get testures and patterns when using geom_area()?
I've seen the ggpattern extension, but it does not seem to work on geom_area(), though I might be wrong.

David R
- 77
- 8
0
votes
0 answers
geom_area() does not display a stacked chart. Why?
I have been trying to make a plot that shows how often a specific world region (Western Europe, North America, etc...) has been covered in an issue of a certain journal.
I'd like the x-axis to display the issue and the y-axis to display the count of…

Firefly05
- 11
- 2
0
votes
0 answers
Graphing two variables into one line chart
Sorry in advance if I'm not very clear in the explanation of my problem (I'm very new to R) but I am trying to graph 2 variables (Average cereal yield, Average land area change) into the same area chart to show the difference between cereal yield…

MM97
- 1
- 1
0
votes
1 answer
Geom_area with different colors for fill
I have a DF with 4 columns: date, original, predicted and change. I would like to make an area graph and the values that are negative are red and the positive ones are green according to the change column.
My code:
data %>%
filter(variaveis ==…

Alexandre Sanches
- 219
- 3
- 10
0
votes
1 answer
Area plot using R tidyverse, ggplot, geom_area
I am using the follow code to generate an area plot using tidyverse, ggplot function and geom_area.
library(tidyverse)
set.seed(12345)
df1 <- data.frame(a = c(2000:2020), b = rnorm(21,25,4), c = rep("x", 21))
df2 <- data.frame(a = c(2006:2020),…

Sylvia Rodriguez
- 1,203
- 2
- 11
- 30
0
votes
1 answer
Geom_area plot doesn't fill the area between the lines
I want to make an area plot with ggplot(mpg, aes(x=year,y=hwy, fill=manufacturer)) + geom_area(), but I get this:
I'm realy new in R world, can anyone explain why it does not fill the area between the lines? Thanks!

Ztrew
- 48
- 1
- 7
0
votes
2 answers
Manually select plot line size from a specific set of variables using scale_color_manual
I am using a geom_area to plot a set of Variables across samples stacked, and I would like to make the lines of a specific "Case" = N bigger and of a specific colour (red). I have already defined the colours, but how can I add the command…

Ecg
- 908
- 1
- 10
- 28
0
votes
2 answers
Plot geom_area with no filling and colouring lines by variable/ or geom_line without variables overlapping
From what I can see, geom_area and geom_line plot variables differently so the area are on top of each other (they have different y-axis start) whereas geom_line they cross and overlap continuously. Do you know why is this?
I would like one of the…

Ecg
- 908
- 1
- 10
- 28
0
votes
1 answer
How to fill a plot below a regression line using ggplot
I have a scatter plot with a regression line and would like to fill the space below the regression line grey.
#my data
p2 = as.data.frame(cbind(Population = c(1432132, 2582830,1628701, 2278906,476179), Borough =c("BRONX", "BROOKLYN", "MANHATTEN",…

maribio18
- 63
- 4
0
votes
0 answers
How to prevent blank polygons when having bordering but not overlapping datapoints when using geom_area in ggplot?
I am trying to fit a area plot that displays the number of visitors for different events over time. My issue is that for the case when one of the events ends at exactly the same point in time when another one starts the graph gets messed up.
The…

dropout
- 17
- 5