|
187 | 187 | annotate!(pl, loc, string(loc))
|
188 | 188 | end
|
189 | 189 | end
|
| 190 | + |
| 191 | + let p = scatter([4], [4], plot_title = "x", xlims = (0, 10), ylims = (0, 10)) |
| 192 | + for sp ∈ p.subplots |
| 193 | + @test sp[:annotations] == [] |
| 194 | + end |
| 195 | + annotate!(4, 4, "4") |
| 196 | + |
| 197 | + for (i, sp) ∈ enumerate(p.subplots) |
| 198 | + if i == p.attr[:plot_titleindex] |
| 199 | + @test sp[:annotations] == [] |
| 200 | + else |
| 201 | + @test length(sp[:annotations]) == 1 |
| 202 | + @test sp[:annotations][1][1] == 4 |
| 203 | + @test sp[:annotations][1][2] == 4 |
| 204 | + @test sp[:annotations][1][3].str == "4" |
| 205 | + end |
| 206 | + end |
| 207 | + end |
| 208 | + |
| 209 | + let p = scatter( |
| 210 | + [4], |
| 211 | + [4], |
| 212 | + plot_title = "x", |
| 213 | + xlims = (0, 10), |
| 214 | + ylims = (0, 10), |
| 215 | + annotations = (4, 4, "4"), |
| 216 | + ) |
| 217 | + for (i, sp) ∈ enumerate(p.subplots) |
| 218 | + if i == p.attr[:plot_titleindex] |
| 219 | + @test sp[:annotations] == [] |
| 220 | + else |
| 221 | + @test length(sp[:annotations]) == 1 |
| 222 | + @test sp[:annotations][1][1] == 4 |
| 223 | + @test sp[:annotations][1][2] == 4 |
| 224 | + @test sp[:annotations][1][3].str == "4" |
| 225 | + end |
| 226 | + end |
| 227 | + end |
| 228 | + |
| 229 | + let p = plot( |
| 230 | + scatter([4], [4], xlims = (0, 10), ylims = (0, 10)), |
| 231 | + scatter([4], [4], xlims = (0, 10), ylims = (0, 10)), |
| 232 | + plot_title = "x", |
| 233 | + ) |
| 234 | + for sp ∈ p.subplots |
| 235 | + @test sp[:annotations] == [] |
| 236 | + end |
| 237 | + annotate!(4, 4, "4") |
| 238 | + |
| 239 | + for (i, sp) ∈ enumerate(p.subplots) |
| 240 | + if i == p.attr[:plot_titleindex] |
| 241 | + @test sp[:annotations] == [] |
| 242 | + else |
| 243 | + @test length(sp[:annotations]) == 1 |
| 244 | + @test sp[:annotations][1][1] == 4 |
| 245 | + @test sp[:annotations][1][2] == 4 |
| 246 | + @test sp[:annotations][1][3].str == "4" |
| 247 | + end |
| 248 | + end |
| 249 | + end |
190 | 250 | end
|
191 | 251 |
|
192 | 252 | @testset "Fonts" begin
|
|
0 commit comments