Merge pull request #3634 from t-bltg/annotate

Allow relative positioning of annotations
This commit is contained in:
t-bltg
2021-08-02 17:28:30 +02:00
committed by GitHub
2 changed files with 73 additions and 58 deletions
+10
View File
@@ -148,4 +148,14 @@ end
@test spl.series_list[3].plotattributes[:series_annotations].strs == ["1/3"]
@test spl.series_list[4].plotattributes[:series_annotations].strs == ["1/4"]
@test spl.series_list[5].plotattributes[:series_annotations].strs == ["1/5"]
p = plot([1, 2], annotations=(1.5, 2, text("foo", :left)))
x, y, txt = p.subplots[end][:annotations][end]
@test (x, y) == (1.5, 2)
@test txt.str == "foo"
p = plot([1, 2], annotations=((.1, .5), :auto))
pos, txt = p.subplots[end][:annotations][end]
@test pos == (.1, .5)
@test txt.str == "(a)"
end