I want to use a palette that is ordered rather than nominal or continuous. If I don’t specify a palette, I get nominal. If I specify a continuous one, I get an error. visual(Scatter, colormap=:viridis)
doesn’t change anything.
using AlgebraOfGraphics, CategoricalArrays, CairoMakie
let n = 100
d = data((x=rand(n), y=rand(n), c=rand(CategoricalArray(1:13, ordered=true), n)))
v = visual(Scatter)
m = mapping(:x, :y, color=:c)
p = d * v * m
draw(p, )
end
using AlgebraOfGraphics, CategoricalArrays, CairoMakie
let n = 100
k = 13
d = data((x=rand(n), y=rand(n), c=rand(CategoricalArray(1:k, ordered=true), n)))
v = visual(Scatter)
m = mapping(:x, :y, color=:c)
p = d * v * m
draw(p, palettes=(color=:cividis))
end
ERROR: LoadError: MethodError: no method matching merge(::NamedTuple{(:layout,), Tuple{AlgebraOfGraphics.Wrap}}, ::NamedTuple{(:color, :marker, :linestyle, :patchcolor, :side), Tuple{Vector{ColorTypes.RGB{Float64}}, Vector{Symbol}, Vector{Symbol}, Vector{ColorTypes.RGB{Float64}}, Vector{Symbol}}}, ::Symbol)
Closest candidates are:
merge(::NamedTuple{an, T} where T<:Tuple, ::NamedTuple{bn, T} where T<:Tuple) where {an, bn} at namedtuple.jl:242
merge(::NamedTuple, ::NamedTuple, ::NamedTuple...) at namedtuple.jl:263
merge(::NamedTuple, ::Any) at namedtuple.jl:277
...
Stacktrace:
[1] compute_axes_grid(fig::Figure, s::AlgebraOfGraphics.Layer; axis::NamedTuple{(), Tuple{}}, palettes::Symbol)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/3zSL9/src/algebra/layers.jl:74
[2] plot!(fig::Figure, s::AlgebraOfGraphics.Layer; axis::NamedTuple{(), Tuple{}}, palettes::Symbol)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/3zSL9/src/algebra/layers.jl:150
[3] plot(s::AlgebraOfGraphics.Layer; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, palettes::Symbol)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/3zSL9/src/algebra/layers.jl:158
[4] draw(s::AlgebraOfGraphics.Layer; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, palettes::Symbol)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/3zSL9/src/algebra/layers.jl:173
[5] top-level scope