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.
本练习是课程的一部分
Introduction to Data Visualization with Julia
练习说明
- Generate a violin plot of
"Retail Price"for tomatoes, withMonthalong the x-axis. - Add a box plot of
"Retail Price"for tomatoes to the same figure, removing the view ofoutliers.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# 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)")