LoslegenKostenlos loslegen

Self-reported conditions

At times, it is necessary to plot multiple elements in a single figure; on some occasions, these elements may overlap. In this exercise, you will utilize transparency to generate a visualization where overlapping elements can be easily observed within the same plot.

The StatsPlots package has already been loaded, giving you access to violin and boxplot, and you can access the conditions DataFrame.

Diese Übung ist Teil des Kurses

Introduction to Data Visualization with Julia

Kurs anzeigen

Anleitung zur Übung

  • Set the theme to :wong, with the default values of framestyle and alpha set to :grid and 0.75, respectively, and hide the legends by default.
  • Generate a violin plot of the self-reported Value against the Condition while setting the linewidth to 0.
  • Include a box plot of the same variables in the figure, with linewidth 2 and linecolor :midnightblue.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Set theme
theme(
	:____, framestyle=:____, label=____, alpha=____
)

# Create violin plot
violin(conditions.____,
    conditions.____,
    linewidth=____)
# Add box plot
boxplot!(conditions.____,
    conditions.____,
    linewidth=____,
    linecolor=:____)
ylabel!("Self-reported Level")
Code bearbeiten und ausführen