CommencerCommencer gratuitement

Tomato seasons

In this exercise, you will analyze tomato prices in different Indian markets by month. You will use a combined box plot and violin plot to visualize the distribution of prices in each month. The box plot will show quartiles, median, and outliers, while the violin plot will show distribution shape, providing insight into patterns and variability.

Both the tomatoes DataFrame and an array month_labels containing month names have been loaded and are ready for use. Before the exercise, examine the format of the Date column in the tomatoes dataset using the interactive shell. The DataFrames, Dates, and StatsPlots packages have been imported for you.

Cet exercice fait partie du cours

Introduction to Data Visualization with Julia

Afficher le cours

Instructions

  • Generate a violin plot of "Retail Price" for tomatoes, with Month along the x-axis.
  • Add a box plot of "Retail Price" for tomatoes to the same figure, removing the view of outliers.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create a violin plot
____(tomatoes.____,
	tomatoes[:, "____"],
    label=false,
    xticks=(1:12, month_labels),
   	color=:crimson)
# Add a box plot to the figure
____(tomatoes.____,
	tomatoes[:, "____"],
	label=false,
    outliers=____,
    color=:turquoise3)
ylabel!("Price (Rupees)")
Modifier et exécuter le code