How to create circular color gradient plot?

We currently don’t have a circular gradient, but I think it has been requested before…
What do you want to achieve? Right now you will need to use a Mesh, to emulate it, e.g. like this:

using GLMakie, LinearAlgebra

cmap = to_colormap(:viridis)
function color(i, j)
    distance_01 = norm(Point2f(i, j)) / sqrt(2)
    return Makie.interpolated_getindex(cmap, distance_01, (0, 1))
end

colors = [color(i, j) for i in -1:0.1:1, j in -1:0.1:1]

mesh(Rect2f(0, 0, 1, 1); color=colors, shading=false)

1 Like