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 ejercicio forma parte del curso
Introduction to Data Visualization with Julia
Instrucciones del ejercicio
- Generate three box plots comparing the distribution of
Hours_per_dayof music streaming (y-axis) versusWhile_workingstatus (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
0to10to ensure consistent scaling across all three box plots.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
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
____(____, ____)