I’d like to be able to specify a colormap, say Dark2, to be used as the automatic colors in the lines plot type. Reading around it seems like I should be using the theming system to do it. Unfortunately I’ve not been able to get it to work. Below is my best attempt thus far but it only results in the following error when I try
ERROR: MethodError: Cannot `convert` an object of type Observable{Any} to an object of type Dict{Symbol, Observable}
Here is the MWE. Any advice on how to proceed would be appreciated. Note I’ve also tried with set_theme!() but have the same error when I do.
function makie_theme_test()
with_theme(
Theme(
palette=(color = :Dark2_8)
Lines = (cycle = [:color])
)
) do
n = 100
x = LinRange(0, 1, n)
f = x .^ 2
g = sin.(2π .* x)
fig = Figure()
ax = Axis(fig[1, 1], xlabel="x", ylabel="y")
lines!(x, f)
lines!(x, g)
display(fig)
end
end
`to_colormap(cm, categories)` is deprecated. Use `Makie.categorical_colors(cm, categories)` for categorical colors, and `resample_cmap(cmap, ncolors)` for continous resampling.
Ah I meant just to_colormap(name) but it only works if you’re using a real categorical colormap with a small number of entries. Not for picking a few colors from a continuous map with many entries.