using CairoMakie, ColorSchemes, Colors
include("makieTheme2.jl") # don't forget to include the theme.
include("makieTheme2.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
cmap = get(colorschemes[:Wistia], LinRange(0,1,length(p)))
fig = Figure(resolution = (470, 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 = :Wistia, label ="p")
fig[1, 1] = ax
fig[1, 2] = cbar
#save("/results/FigBlackBackground.svg", fig, pt_per_unit = 0.7);
#save("./results/FigBlackBackground.png", fig, px_per_unit = 1);
fig
ecycl_x(r,k,θ) = r*(k .+ 1).*cos.(θ) .- r*cos.((k .+ 1) .* θ)
ecycl_y(r,k,θ) = r*(k .+ 1).*sin.(θ) .- r*sin.((k .+ 1) .* θ)
θ = LinRange(0,6.2π,1000)
tronLegacy = ["#FF410DFF", "#6EE2FFFF", "#F7C530FF", "#95CC5EFF",
"#D0DFE6FF", "#F79D1EFF", "#748AA6FF"];
fig = Figure(resolution = (470, 400), font = :sans)
ax = Axis(fig, aspect =1,title = "Epicycloid", titlecolor = :white, #not working!
xlabel = "x(θ) = r(k+1)cos(θ) -rcos((k+1)θ)",
ylabel ="y(θ) = r(k+1)cos(θ) -rcos((k+1)θ)")
#lines!(ax, ecycl_x(1,1,θ), ecycl_y(1,1,θ), color = :red)
lins = [lines!(ecycl_x(2k,k,θ), ecycl_y(2k,k,θ), linewidth = 1.5,
color = tronLegacy[indx]) for (indx,k) in enumerate(2:0.5:5)]
leg = Legend(fig, lins, string.(2:0.5:5), "k , r=2k", tellheight = true,
tellwidth = true, nbanks = 1)
fig[1, 1] = ax
fig[1, 2] = leg
#save("./results/FigBlackBackground2.png", fig, px_per_unit = 1);
fig
include("makieTheme3.jl") # don't forget to include the theme.
using CairoMakie, ColorSchemes, Colors
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
cmap = get(colorschemes[:Wistia], LinRange(0,1,length(p)))
fig = Figure(resolution = (470, 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 = :Wistia, label ="p")
fig[1, 1] = ax
fig[1, 2] = cbar
#save("/results/FigBlackBackground.svg", fig, pt_per_unit = 0.7);
#save("./results/FigBlueBackground.png", fig, px_per_unit = 1);
fig
ecycl_x(r,k,θ) = r*(k .+ 1).*cos.(θ) .- r*cos.((k .+ 1) .* θ)
ecycl_y(r,k,θ) = r*(k .+ 1).*sin.(θ) .- r*sin.((k .+ 1) .* θ)
θ = LinRange(0,6.2π,1000)
tronLegacy = ["#FF410DFF", "#6EE2FFFF", "#F7C530FF", "#95CC5EFF",
"#D0DFE6FF", "#F79D1EFF", "#748AA6FF"];
fig = Figure(resolution = (470, 400), font = :sans)
ax = Axis(fig, aspect =1,title = "Epicycloid", titlecolor = :white, #not working!
xlabel = "x(θ) = r(k+1)cos(θ) -rcos((k+1)θ)",
ylabel ="y(θ) = r(k+1)cos(θ) -rcos((k+1)θ)")
#lines!(ax, ecycl_x(1,1,θ), ecycl_y(1,1,θ), color = :red)
lins = [lines!(ecycl_x(2k,k,θ), ecycl_y(2k,k,θ), linewidth = 1.5,
color = tronLegacy[indx]) for (indx,k) in enumerate(2:0.5:5)]
leg = Legend(fig, lins, string.(2:0.5:5), "k , r=2k",nbanks = 1)
fig[1, 1] = ax
fig[1, 2] = leg
#save("./results/FigBlueBackground2.png", fig, px_per_unit = 1);
fig
using CairoMakie, ColorSchemes, Colors
ecycl_x(r,k,θ) = r*(k .+ 1).*cos.(θ) .- r*cos.((k .+ 1) .* θ)
ecycl_y(r,k,θ) = r*(k .+ 1).*sin.(θ) .- r*sin.((k .+ 1) .* θ)
θ = LinRange(0,6.2π,1000)
tronLegacy = ["#FF410DFF", "#6EE2FFFF", "#F7C530FF", "#95CC5EFF",
"#D0DFE6FF", "#F79D1EFF", "#748AA6FF"];
fig = Figure(resolution = (470, 400), font = :sans)
ax = Axis(fig, aspect =1,title = "Epicycloid", titlecolor = :white, #not working!
xlabel = "x(θ) = r(k+1)cos(θ) -rcos((k+1)θ)",
ylabel ="y(θ) = r(k+1)cos(θ) -rcos((k+1)θ)")
#lines!(ax, ecycl_x(1,1,θ), ecycl_y(1,1,θ), color = :red)
lins = [lines!(ecycl_x(2k,k,θ), ecycl_y(2k,k,θ), linewidth = 1.5,
color = tronLegacy[indx]) for (indx,k) in enumerate(2:0.5:5)]
leg = Legend(fig, lins, string.(2:0.5:5), "k , r=2k",nbanks = 1)
fig[1, 1] = ax
fig[1, 2] = leg
#save("./results/FigBlueBackground2.png", fig, px_per_unit = 1);
fig
include("makieTheme5.jl") # don't forget to include the theme.
using CairoMakie, ColorSchemes, Colors
include("makieTheme2.jl") # don't forget to include the theme.
x = 0:0.3:4
a = exp.(- x)
b = exp.(- x.^2)
fig = Figure(resolution = (600,400), font = :sans)
ax = Axis(fig, xlabel = "x", ylabel ="y")
lina = lines!(x, a, color = ("#08F7FE",0.8))
glowA = [lines!(x, a, color = ("#08F7FE", 0.09), linewidth = 1 + 0.8*i) for i in 1:10]
linb = lines!(x, b, color = ("#FFE64D",0.8))
glowB = [lines!(x, b, color = ("#FFE64D", 0.09), linewidth = 1 + 0.8*i) for i in 1:10]
pnta = scatter!(x, a, color = "#08F7FE", markersize=5,
strokecolor = "#08F7FE", glowwidth = 2, glowcolor = "#08F7FE")
fillA = band!(x, fill(0,length(x)), a; color = ("#08F7FE", 0.08))
pntb = scatter!(x, b, color = "#FFE64D", markersize=5,
strokecolor = "#FFE64D", glowwidth = 2, glowcolor ="#FFE64D")
fillB = band!(x, a, b; color = ("#FFE64D", 0.08))
leg = Legend(fig, [[lina, pnta], [linb, pntb]], ["exp(-x)", "exp(-x²)"])
fig[1, 1] = ax
fig[1, 1] = leg
#save("./results/FigBlackBackground3.png", fig, px_per_unit = 2);
fig
using GLMakie, ColorSchemes, Colors
include("makieTheme2.jl") # don't forget to include the theme.
# archimedean spiral
a, m, z₀ = 1, 2.1, 0
φ = LinRange(0,20π,500)
r = a*φ
x, y, z = r .* cos.(φ), r .* sin.(φ), m .* r .+ z₀;
fig = Figure(resolution = (900, 800))
ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))
line3d = lines!(x, y, z, color = z, colormap = :viridis)
lines!(x, y, 0*z, color = z, colormap = (:viridis, 0.35))
axis = ax.scene[OldAxis]
axis[:names, :axisnames] = ("x", "y", "z")
tstyle = axis[:names] # get the nested attributes and work directly with them
tstyle[:textsize] = 10
tstyle[:textcolor] = (:red, :green, :white)
tstyle[:font] = "helvetica"
tstyle[:gap] = 5
axis[:ticks][:textcolor] = :white
axis[:ticks][:textsize] = 5
cbar = Colorbar(fig, line3d, label = "z",ticklabelsize = 14,
width = 12, height = Relative(2/4), tickalign=0)
fig[1, 1] = ax
fig[1, 2] = cbar
#save("./results/FigLines3D.png", fig, px_per_unit = 1)
fig
U = LinRange(0,10π, 80)
V = LinRange(0,2π, 20)
x = [(1-0.1*cos(v))*cos(u) for u in U, v in V]
y = [(1-0.1*cos(v))*sin(u) for u in U, v in V]
z = [0.1*(sin(v) + u/1.7 - 10) for u in U, v in V];
wireframe(x,y,z, color = :orange)
using GLMakie, ColorSchemes, Colors
U = LinRange(0,10π, 80)
V = LinRange(0,2π, 20)
x = [(1-0.1*cos(v))*cos(u) for u in U, v in V]
y = [(1-0.1*cos(v))*sin(u) for u in U, v in V]
z = [0.1*(sin(v) + u/1.7 - 10) for u in U, v in V];
fig = Figure(resolution = (900, 800))
ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))
line3d = wireframe!(x,y,z, color = :white)
axis = ax.scene[OldAxis]
axis[:names, :axisnames] = ("x", "y", "z")
tstyle = axis[:names] # get the nested attributes and work directly with them
tstyle[:textsize] = 12
tstyle[:textcolor] = (:red, :green, :white)
tstyle[:font] = "helvetica"
tstyle[:gap] = 5
axis[:ticks][:textcolor] = :white
axis[:ticks][:textsize] = 5
#cbar = Colorbar(fig, line3d, label = "z",ticklabelsize = 12,
# width = 12, height = Relative(2/4), tickalign=0)
fig[1, 1] = ax
#fig[1, 2] = cbar
#save("./results/FigWire.png", fig, px_per_unit = 1)
fig
fig = Figure(resolution = (900, 800))
ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))
line3d = surface!(ax, x, y, z, colormap = :plasma, shading=false)
axis = ax.scene[OldAxis]
axis[:names, :axisnames] = ("x", "y", "z")
tstyle = axis[:names] # get the nested attributes and work directly with them
tstyle[:textsize] = 12
tstyle[:textcolor] = (:red, :green, :white)
tstyle[:font] = "helvetica"
tstyle[:gap] = 5
axis[:ticks][:textcolor] = :white
axis[:ticks][:textsize] = 5
cbar = Colorbar(fig, line3d, label = "z",ticklabelsize = 14,
width = 12, height = Relative(2/4), tickalign=0)
fig[1, 1] = ax
fig[1, 2] = cbar
#save("./results/FigWireSurf.png", fig, px_per_unit = 1)
fig