Data Science Desktop Survival Guide
by Graham Williams |
|||||
Box Plot Distributions |
Raw
ds %>%
mutate(year=factor(format(ds$date, "%Y"))) %>% ggplot(aes(x=year, y=max_temp, fill=year)) + geom_boxplot(notch=TRUE) + theme(legend.position="none")
A box plot, also known as a box and whiskers plot, shows the median (the second quartile) within a box which extends to the first and third quartiles. We note that each quartile delimits one quarter of the dataset and hence the box itself contains half the dataset. Colour is added simply to improve the visual appeal of the plot rather than to convey new information. Since we include fill= we also turn off the otherwise included legend. Here we observe the overall change in the maximum temperature over the years. Notice the first and last plots which probably reflect truncated data, providing motivation to confirm this in the data, before making significant statements regarding these observations.
|