IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to Data Visualization with Julia

Visualizza il corso

Istruzioni dell'esercizio

  • Generate three box plots comparing the distribution of Hours_per_day of music streaming (y-axis) versus While_working status (x-axis), grouped by Music_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 to 10 to ensure consistent scaling across all three box plots.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

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
____(____, ____)
Modifica ed esegui il codice