Questions tagged [ggridges]

The ggridges R package is an add-on package to ggplot2. It provides geoms, stats, themes, and scales useful for the creation of ridgeline plots.

Resources:

  1. Introduction to ggridges
  2. github project
102 questions
2
votes
2 answers

R ggridges plot - Showing y axis ticks and labels

I am trying to generate overlay density plots over time, comparing densities of males vs. females. Here is my output: I am following the Australian athletes height example from…
user2450223
  • 235
  • 2
  • 10
2
votes
0 answers

Conditional or arbitrary fill in ggridge (R)

I'm trying to shade the area under the curve to the right of a given x, which is not the same for all the density plots, but it varies according to the level of y. For example, On the package vignette I can only find solutions to shade the areas…
Andrea M
  • 2,314
  • 1
  • 9
  • 27
2
votes
1 answer

Add shaded region across all panels in ridgeline plot

I have a dataframe df: set.seed(3467) df<- data.frame(method= c(rep("A", 1000), rep("B", 1000), rep("C", 1000)), beta=c(rnorm(1000, mean=0, sd=1),rnorm(1000, mean=2, sd=1.4),rnorm(1000, mean=0, sd=0.5))) I wish to create a ridge…
Danielle
  • 785
  • 7
  • 15
2
votes
2 answers

Shade an area under density curve, to mark the Highest Density Interval (HDI)

I thought this should be straightforward, but I'm lost, despite tons of information online. My Problem: I have a vector of data points, for which I want to plot a density curve, then color the area under the curve to signify the Highest Density…
Emman
  • 3,695
  • 2
  • 20
  • 44
2
votes
1 answer

Lines overlapping in R with ggridges

I use ggridges in R to visualize my data. But a lot of the lines are overlapping and are hard to read. My code is: ggplot(task1, aes(x = ibu, y = style, fill = style)) + geom_density_ridges(alpha=1) + theme_ridges() + theme(legend.position =…
iilla
  • 105
  • 7
2
votes
1 answer

Assigning specific colors to specific cases in ridgeline plots in R

Recently this community helped me tremendously with getting Ridgeline plots to work with my data. Now I am struggling with coloring them according to my needs. Basically what I want is plotting my cases in different orders but they should keep a…
Klaus Peter
  • 125
  • 7
2
votes
2 answers

Plotting normal distributions in a ridgeline plot with ggridges

I'm a little embarrassed to ask this question but I've spent the better part of my work day trying to find a solution, yet and here I am... What I'm aiming for is a simple ridgeline plot of several normal distributions which are calculated from…
Klaus Peter
  • 125
  • 7
2
votes
1 answer

plotting two categorical vectors in ggridges

I have a dataset with a few organisms, which I would like to plot on my y-axis, against date, which I would like to plot on the x-axis. However, I want the fluctuation of the curve to represent the abundance of the organisms. I.e I would like to…
2
votes
1 answer

Visualization of Groups of Poisson random samples using ggridges

I have two sets of data, all in one data frame. The first set is related to data collected in Location 1 and the second set is collected in Location 2. Each location has different count data (column value) for 5 months. #…
bison2178
  • 747
  • 1
  • 8
  • 22
2
votes
1 answer

R: Weighted Joyplot/Ridgeplot/Density Plot?

I am trying to create a joyplot using the ggridges package (based on ggplot2). The general idea is that a joyplot creates nicely scaled stacked density plots. However, I cannot seem to produce one of these using weighted density. Is there some way…
socialscientist
  • 3,759
  • 5
  • 23
  • 58
1
vote
2 answers

How can I add fill gradient color to a density plot in R with only one variable

I have data that has two columns - date and values. I can create density plot with geom_density function. I would like to fill it with gradient color f.e. blue to red but I can't find how to do it. Anything I find on the internet requires Y value…
1
vote
1 answer

Is it possible to visualise groups within ggplot geom_density_ridges?

I have built a nice graph that shows daily time patterns per day of the week. Within each curve for each day of the week I would like to visualise the data by group. Grouping should occur from the column "ID" that I can either set to True/False or…
Simon
  • 45
  • 4
1
vote
1 answer

extend axis to 0 with geom_density_ridges2

The following code produces: The min value in df is 4, but I would like the breaks and the axis to extend to 0. I do not need the axis to extend past 9. I've tried adding limits, but the geom shifts. The plot is based on an example from the…
Eric Green
  • 7,385
  • 11
  • 56
  • 102
1
vote
1 answer

Align ridgeplots

I have created two separate ridgeplots in R using the ggridge package and the stat_density_ridges() function. My dataset includes a series of Latitude and Longitude locations. I have produced one ridgeplot for Latitute and one for Longitude and they…
1
vote
1 answer

How to apply density ridges on pre aggregated data in R?

Looking for a way to graph density ridges on pre aggregated data. Is there a way to feed pre aggregated data to geom_density_ridges or something similar? Particularly looking for a solution that doesn't entail blowing out replicates/rows from the…