improved_bar_plot <-
base_bar_plot +
labs(
title = "Student Count by Employment and Enrollment Status",
subtitle = "Most students work part-time while enrolled full-time",
x = "Employment Status",
y = "Number of Students",
fill = "Course Enrollment",
caption = "Data source: American Time Use Survey 2024 (n = 312 students)"
)
improved_bar_plottheme_minimal
Other themes include but not limited to: theme_bw(), theme_light(), theme_dark(), theme_classic().
theme() functionimproved_bar_plot <-
improved_bar_plot +
theme(
plot.title = element_text(size = 18),
plot.subtitle = element_text(size = 14),
axis.title = element_text(size = 12),
axis.text = element_text(size = 10),
legend.title = element_text(size = 11),
legend.text = element_text(size = 9),
plot.caption = element_text(size = 8)
) +
labs(title = "Student Count by Employment and \n Enrollment Status")
improved_bar_plot
Figure 6: Nine colors randomly selected from R colors as listed by the colors() function
Figure 7: Hex codes for the randomly selected nine colors
Figure 8: Hex codes of colors in the Okabe-Ito palette
Figure 10: Default Bar Plot
Figure 11: Improved Bar plot
Figure 14: Time spent alone versus weekly earnings broken by employment and enrollment status using facets
Figure 15: Time spent alone versus weekly earnings broken by employment status
An assistive technology is any form of technology (software, device) that helps people with disabilities perform certain activities (e.g. walking sticks, wheel chairs).
A screen reader is a form of assistive technology that allows blind and visually impaired users, and people with other disabilities (e.g., dyslexia) to read what is on their computer screen.
If you have never heard of a screen reader reading a text, you can listen to this audio.
A screen reader can read text, but non-text elements such as images cannot be read.
Instead a screen reader would say something along the lines of “Image.png”.
In order to make an image visually accessible, we can rely on alternate text.
Alternate text or alt text describes contents of an image and can be read by screen readers.
improved_bar_plot +
labs(
alt = "Barplot showing student count by employment and enrollment status. The y-axis shows number of students from 0 to 80, and the x-axis shows employment status (Full Time, Part Time, NA). Each employment status is broken down by full time or part time enrollment status. The plot displays six bars: students enrolled full time with full time employment (approximately 70 students), part time employment (apprximately 75 students), and unknown employment (approximately 80 students) as well as students enrolled part time with full time employment (approxmately 60 students), part time employment (approximately 18 students), and unknown employment (approximately 15 students). Data source: American Time Use Survey 2024 (n = 312 students)."
)Figure 16: Bar plot of employment broken down by enrollment status with added alternative text in the background
The alt text is never displayed in the front end.
The alt text is stored on the back end of a web page and is legible by screen readers.
If you are reading these slides using a screen reader, you should hear the alt text for the plot in the previous slide.
You should always write alt text for all images (ggplot or not), whether you use R or Quarto or not, whether you are doing work for STATS 6 or any other courses or any non-course work.
An effective alt text communicates the labels of the axes, the variables represented, ranges and values for each variable and group as seen in the visualization.
Most importantly alt text should convey the overall message of the visualization.
Writing the overall message of the visualization is crucial and practicing this skill will help you take the time to understand the visualizations you work with in depth.
If you were to listen to the output of the sonify() function, you would hear a series of ten tones, each one slightly higher in pitch than the last. The rising pitch directly corresponds to the rising y values as x increases. This auditory experience mirrors the visual experience of seeing the line go up and to the right, providing an alternative way to perceive the linear relationship between x and y.
Data tactualization refers to making data visualization in a form so that it can be touchable. The video shows printing of a tactile boxplot that one can touch using a Swell machine.