ComeçarComece de graça

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.

Este exercício faz parte do curso

Introduction to Data Visualization with Julia

Ver curso

Instruções do exercício

  • 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.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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)")
Editar e executar o código