Skip to content

Commit 2d8b074

Browse files
committed
Change labels and scaling
1 parent 595eb88 commit 2d8b074

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/sliders.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ function figure_eight_path(A, B, C, D, x0, y0, theta, num_points)
1414
return x_final, y_final
1515
end
1616

17-
A = 10.0 # width of the figure-eight
18-
B = 5.0 # height of the figure-eight
17+
A = 20.0 # width of the figure-eight
18+
B = 10.0 # height of the figure-eight
1919
C = Observable(0.0) # size of right part of the figure-eight
2020
D = Observable(0.0) # asymmetry factor
2121
x0 = 0.0 # center x-coordinate
22-
y0 = 0.0 # center y-coordinate
22+
y0 = 25.0 # center y-coordinate
2323
theta = 0*π/6 # rotation angle in radians
2424
num_points = 200
2525

@@ -38,7 +38,8 @@ x = @lift(figure_eight_x($C, $D))
3838

3939
# Create the figure and axis
4040
fig = Figure()
41-
ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")
41+
ax = Axis(fig[1, 1], xlabel = "azimuth [°]", ylabel = "elevation [°]",
42+
title = "Figure of Eight Path")
4243

4344
# Plot the sine wave
4445
lineplot = lines!(ax, x, y)
@@ -47,7 +48,7 @@ lineplot = lines!(ax, x, y)
4748
sg = SliderGrid(
4849
fig[2, 1],
4950
(label = "C", range = -2.0:0.01:2.0, startvalue = 0.0),
50-
(label = "D", range = -2:0.01:2.0, startvalue = 0.0)
51+
(label = "D", range = -3:0.01:3.0, startvalue = 0.0)
5152
)
5253

5354
# Connect sliders to observables

0 commit comments

Comments
 (0)