3030 @test sc ∉ ax. scene. plots
3131 empty! (ax)
3232 @test isempty (ax. scene. plots)
33- end
33+ end
34+
35+ @testset " Axis limits basics" begin
36+ f = Figure ()
37+ ax = Axis (f[1 , 1 ], targetlimits = BBox (0 , 10 , 0 , 20 ), limits = (nothing , nothing ))
38+ @test ax. finallimits[] == BBox (0 , 10 , 0 , 20 )
39+ @test ax. limits[] == (nothing , nothing )
40+ xlims! (ax, - 10 , 10 )
41+ @test ax. limits[] == ((- 10 , 10 ), nothing )
42+ @test ax. finallimits[] == BBox (- 10 , 10 , 0 , 20 )
43+ ylims! (ax, - 20 , 30 )
44+ @test ax. limits[] == ((- 10 , 10 ), (- 20 , 30 ))
45+ @test ax. finallimits[] == BBox (- 10 , 10 , - 20 , 30 )
46+ limits! (ax, - 5 , 5 , - 10 , 10 )
47+ @test ax. finallimits[] == BBox (- 5 , 5 , - 10 , 10 )
48+ @test ax. limits[] == ((- 5 , 5 ), (- 10 , 10 ))
49+ ax. limits[] = (nothing , nothing )
50+ ax. xautolimitmargin = (0 , 0 )
51+ ax. yautolimitmargin = (0 , 0 )
52+ scatter! (Point2f0[(0 , 0 ), (1 , 2 )])
53+ @test ax. limits[] == (nothing , nothing )
54+ @test ax. targetlimits[] == BBox (0 , 1 , 0 , 2 )
55+ @test ax. finallimits[] == BBox (0 , 1 , 0 , 2 )
56+ scatter! (Point2f0 (3 , 4 ))
57+ @test ax. limits[] == (nothing , nothing )
58+ @test ax. targetlimits[] == BBox (0 , 3 , 0 , 4 )
59+ @test ax. finallimits[] == BBox (0 , 3 , 0 , 4 )
60+ limits! (ax, - 1 , 1 , 0 , 2 )
61+ @test ax. limits[] == ((- 1 , 1 ), (0 , 2 ))
62+ @test ax. targetlimits[] == BBox (- 1 , 1 , 0 , 2 )
63+ @test ax. finallimits[] == BBox (- 1 , 1 , 0 , 2 )
64+ scatter! (Point2f0 (5 , 6 ))
65+ @test ax. limits[] == ((- 1 , 1 ), (0 , 2 ))
66+ @test ax. targetlimits[] == BBox (- 1 , 1 , 0 , 2 )
67+ @test ax. finallimits[] == BBox (- 1 , 1 , 0 , 2 )
68+ autolimits! (ax)
69+ @test ax. limits[] == (nothing , nothing )
70+ @test ax. targetlimits[] == BBox (0 , 5 , 0 , 6 )
71+ @test ax. finallimits[] == BBox (0 , 5 , 0 , 6 )
72+ xlims! (- 10 , 10 )
73+ @test ax. limits[] == ((- 10 , 10 ), nothing )
74+ @test ax. targetlimits[] == BBox (- 10 , 10 , 0 , 6 )
75+ @test ax. finallimits[] == BBox (- 10 , 10 , 0 , 6 )
76+ scatter! (Point2f0 (11 , 12 ))
77+ @test ax. limits[] == ((- 10 , 10 ), nothing )
78+ @test ax. targetlimits[] == BBox (- 10 , 10 , 0 , 12 )
79+ @test ax. finallimits[] == BBox (- 10 , 10 , 0 , 12 )
80+ autolimits! (ax)
81+ ylims! (ax, 5 , 7 )
82+ @test ax. limits[] == (nothing , (5 , 7 ))
83+ @test ax. targetlimits[] == BBox (0 , 11 , 5 , 7 )
84+ @test ax. finallimits[] == BBox (0 , 11 , 5 , 7 )
85+ scatter! (Point2f0 (- 5 , - 7 ))
86+ @test ax. limits[] == (nothing , (5 , 7 ))
87+ @test ax. targetlimits[] == BBox (- 5 , 11 , 5 , 7 )
88+ @test ax. finallimits[] == BBox (- 5 , 11 , 5 , 7 )
89+ end
0 commit comments