Streaming while working
In this exercise, you will compare the daily hours of music streaming between respondents who stream during work and those who do not. The results will be grouped based on self-reported music effects on mental health, allowing for a meaningful comparison.
You can work with the provided streaming
DataFrame, and the StatsPlots
package has already been loaded for your convenience, so you can access the boxplot()
function.
Este exercício faz parte do curso
Introduction to Data Visualization with Julia
Instruções do exercício
- Generate three box plots comparing the distribution of
Hours_per_day
of music streaming (y-axis) versusWhile_working
status (x-axis), grouped byMusic_effects
, arranging the plots in a single row. - Assign the x-axis label as
"Music While Working"
, ensuring it is only displayed in the middle plot and the y-axis label as"Hours Per Day
", making it visible only in the first plot. - Set the y-axis bounds to span from
0
to10
to ensure consistent scaling across all three box plots.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
theme(:vibrant)
# Box plots
boxplot(
streaming.____, streaming.____,
group=streaming.____,
outliers=false, linewidth=1,
color=[:darkorange :springgreen2 :slateblue3],
# Grid layout
layout=(____, ____),
# Axis labels
xlabel=[____],
ylabel=[____]
)
# Set y-axis limits
____(____, ____)