Iris dataset
using CairoMakie, RDatasets, Random, Colors
Random.seed!(123)
dset = dataset("datasets", "iris")
byCat = dset.Species
categ = unique(byCat)
markers = [:circle, :diamond, :utriangle]
fig = Figure(resolution=(600, 400))
ax = Axis(fig[1, 1], xlabel="Sepal Length", ylabel="Sepal Width")
for (idx, c) in enumerate(categ)
indices = findall(x -> x == c, byCat)
scatter!(dset.SepalLength[indices], dset.SepalWidth[indices];
marker=markers[idx], color = rand(RGBf),
markersize=15, label="$(c)")
end
axislegend("Species")
fig
Warning
This example was autogenerated using:
using Pkg
Pkg.status(["CairoMakie", "RDatasets", "Colors"])
Status `~/work/BeautifulMakie/BeautifulMakie/docs/Project.toml`
[13f3f980] CairoMakie v0.10.6
[5ae59095] Colors v0.12.10
[ce6b1742] RDatasets v0.7.7
This page was generated using Literate.jl.