Unlocking Survey Data: How to Visualize Rating Scales with R
- Bernard Kilonzo
- Jun 16
- 3 min read

What are Rating Scales?
A rating scale in survey data is a tool used to measure respondents' attitudes, opinions, or perceptions on a specific topic. It allows people to express the degree to which they agree, disagree, or feel about something. Rating scales come in various formats, including:
Likert Scale – One of the most common types, it typically ranges from “Strongly Disagree” to “Strongly Agree” in five or seven points.
Numerical Scale – Respondents rate on a scale of numbers, such as 1 to 10, where 1 means low satisfaction and 10 means high satisfaction.
Semantic Differential Scale – Measures opinions using opposite adjectives, like “Happy” vs. “Sad,” and respondents mark a point between them.
Star or Visual Scales – Often used in online reviews, where respondents give a star rating from one to five.
Each type of scale is designed to capture different aspects of feedback, making survey results more meaningful and easier to analyze.
Examples of Rating Scale Questions


How to Visualize Rating Scales in R
The common approach to visualizing rating scale data such as the one resulting from the above two examples is by plotting a stacked bar chart showing the proportion of responses for each question being evaluated - as shown below.

Note that I have shared extensively on how to analyze and visualize survey data using Tableau through an article accessible through this link
In this article, I would like to take a different approach by demonstrating how you can present the same data differently using ridgeline plots.
Visualizing Rating Scales in R using Ridgeline or Density Plots
In this section, I have shared a step-by-step guide on how to visualize Question 4, shared in the introduction section of this article.
To do so, load the required libraries and data as shown below.
Load libraries
library(tidyverse)
library(ggridges)
Load data
survey_data<-read.csv("https://raw.githubusercontent.com/bernardkilonzo-rigor/dataviz/refs/heads/main/data/Survey_Data_Raw.csv")
Next, shape the data using pivot_longer as shown below.
Shaping data
Pivoting_Q4<-survey_data%>%pivot_longer(Q4a:Q4g, names_to = "Questions",
values_to = "Responses")
Visualize the data using the code below.
Building the view
Pivoting_Q4%>%ggplot(aes(y = Questions, x = Responses, fill = stat(x)))+
geom_density_ridges_gradient()+
scale_fill_paletteer_c("ggthemes::Red-Green-Gold Diverging")+
labs(title = "Evaluating Overall Quality of Materials (rating:
(1) - Highly dissatisfied, (5) - Highly satisfied)", fill = "Rating")+
theme(panel.background = element_blank(),
axis.line = element_line(colour = "gray55"),
plot.title = element_text(family = "serif", face = "bold",size = 12 ,color = "gray20"))
See the resulting view.

By following the same approach, you can visualize Question 6, by simply making a few changes as shown below.
Shape the data using pivot_longer as shown below.
Shaping data
Pivoting_Q6<-survey_data%>%pivot_longer(Q6a:Q6e, names_to = "Questions",
values_to = "Responses")
Visualize the data using the code below.
Building the view
Pivoting_Q6%>%ggplot(aes(y = Questions, x = Responses, fill = stat(x)))+
geom_density_ridges_gradient()+
scale_fill_paletteer_c("ggthemes::Red-Green-Gold Diverging")+
labs(title = "Likelihood of Recommending Products to Friends (Rating:
(1) - Not at all likely, (10) - Extremely likely)", fill = "Rating")+
theme(panel.background = element_blank(),
axis.line = element_line(colour = "gray55"),
plot.title = element_text(family = "serif", face = "bold",size = 12 ,color = "gray20"))
See the resulting view.

From the above two visualizations, you can tell that - density plots show full data distribution, making trends and peaks easier to see. They use space efficiently, allowing compact visualization, and help avoid misinterpretation common in stacked bar plots. They provide clearer comparisons of multiple categories and highlight shifts in survey responses between categories.
Conclusion
Density plots offer a powerful way to visualize rating scales in R, providing insights into the distribution of responses and helping identify patterns, skewness, or clusters within the data. Unlike bar charts or stacked Likert plots, density plots focus on the smooth representation of response frequencies, making it easier to detect subtle trends that might be obscured in traditional visualizations.
While density plots are best suited for continuous or transformed ordinal data, careful preprocessing—such as converting Likert-scale responses into numerical values—can ensure meaningful visual output. Pairing density plots with complementary techniques like histograms or box plots can provide a more holistic view of rating distributions.
If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!
Thank you for reading!