Scatters with colormaps

using CairoMakie, Random, ColorSchemes

Random.seed!(123)
n = 50
x, y, color = rand(n), rand(n), rand(n)
cmaps = [:cool, :viridis, :plasma, :inferno, :thermal,
    :leonardo, :winter, :spring, :ice]
markers = [:+, :diamond, :star4, :rtriangle, :rect,
    :circle, :pentagon, :cross, :star5]

function FigGridScatters()
    fig = Figure(resolution = (1200, 800))
    c = 1
    for i in 1:2, j in 1:2:5
        ax = Axis(fig[i, j], aspect = AxisAspect(1))
        pnts = scatter!(x, y .^ c; color = color, colormap = cmaps[c],
            markersize = 15, marker = markers[c], strokewidth = 0)
        cbar = Colorbar(fig, pnts, height = Relative(0.75), tickwidth = 2,
            tickalign = 1, width = 14, ticksize = 14)
        fig[i, j+1] = cbar
        limits!(ax, -0.1, 1.1, -0.1, 1.1)
        ax.xticks = [0, 1]
        ax.yticks = [0, 1]
        ax.xticklabelsize = 20
        ax.yticklabelsize = 20
        c += 1
    end
    fig
end
fig = FigGridScatters()

Warning

This example was autogenerated using:

using Pkg
Pkg.status(["CairoMakie", "ColorSchemes"])
Status `~/work/BeautifulMakie/BeautifulMakie/docs/Project.toml`
  [13f3f980] CairoMakie v0.10.6
  [35d6a980] ColorSchemes v3.21.0

This page was generated using Literate.jl.