Visualizing univariate distributions
Visualizing the distribution of a single random variable is a pretty common task. Therefore, there are multiple named plots we can use for this. These visualizations help us see a variable distribution’s location, dispersion, and shape. They are also helpful in comparing the distribution of different variables or the same variable in different conditions. This section will discuss the most common plots for visualizing univariate data and show you how to create them with Julia while focusing on StatsPlots
.
In this section, we will look at examples for StatsPlots
, Gadfly
, and Makie. Note that those packages can export functions with the same name; for instance, StatsPlots
and AlgebraOfGraphics
export histogram
. If you want to load multiple plotting packages in the same session, you will need to use the qualified names for those functions, such as StatsPlots.histogram
or AlgebraOfGraphics.histogram
; otherwise, you will see an UndefVarError...