November 2018
Intermediate to advanced
460 pages
14h 1m
English
A powerful feature of Plots.jl is the generation of subplots. This allows visualizing several plots on one screen. Let's consider a scatter plot matrix for the very well-known Iris dataset. We load the dataset from the test file present in the DataFrames.jl package:
using CSViris = CSV.read(joinpath(dirname(pathof(DataFrames)),"..","test/data/iris.csv"));
Now, let's create a matrix of subplots. Please note how we construct an array of plots that is subsequently appended within the loop:
font_h6 = Plots.font("Helvetica", 6)plts = Plots.Plot[]for i in 1:4, j in 1:4 if i == j push!(plts,histogram(iris[i],group=iris[:Species], xlabel=names(iris)[j],ylabel="count", legend=false,fillalpha=0.5, guidefont=font_h6,tickfont=font_h6 ...
Read now
Unlock full access