using CairoMakie, ColorSchemes
include("makieTheme1.jl") # don't forget to include the theme.
xs = 0:0.01:1
p = -10:1:10
p= filter(x->x != 0,collect(p))
ys = zeros(length(xs), length(p))
for (indx,i) in enumerate(p)
if i <= -1
ys[:,indx]= xs .^(1/abs(i))
elseif i>= 1
ys[:,indx]= xs .^i
end
end
cbarPal = :thermal
cmap = get(colorschemes[cbarPal], LinRange(0,1,length(p)))
fig = Figure(resolution = (550, 400), font =:sans)
ax = Axis(fig, aspect = 1, xlabel = "x", ylabel = "x^p")
lins = [lines!(xs, ys[:,v], color = cmap[v]) for v in 1:length(p)]
cbar = Colorbar(fig, limits =(-10.01,10.01),
nsteps = length(p), colormap = :thermal, label ="p")
fig[1, 1] = ax
fig[1, 2] = cbar
#save("/results/FigcbarRight.svg", scene, pt_per_unit = 0.7);
#save("./results/FigcbarRight.png", fig, px_per_unit = 2)
fig