axis cs for annotations

This commit is contained in:
Simon Christ 2019-11-27 12:23:39 +01:00
parent 58cf8e471e
commit 68b344e7c3

View File

@ -591,20 +591,17 @@ end
function pgfx_add_annotation!(o, x, y, val, thickness_scaling = 1) function pgfx_add_annotation!(o, x, y, val, thickness_scaling = 1)
# Construct the style string. # Construct the style string.
# Currently supports color and orientation
cstr = val.font.color cstr = val.font.color
a = alpha(cstr) a = alpha(cstr)
push!(o, ["\\node", push!(o, ["\\node",
PGFPlotsX.Options( PGFPlotsX.Options(
get(_pgfx_annotation_halign,val.font.halign,"") => nothing, get(_pgfx_annotation_halign, val.font.halign, "") => nothing,
"color" => cstr, "color" => cstr,
"draw opacity" => convert(Float16, a), "draw opacity" => convert(Float16, a),
"rotate" => val.font.rotation, "rotate" => val.font.rotation,
"font" => pgfx_font(val.font.pointsize, thickness_scaling) "font" => pgfx_font(val.font.pointsize, thickness_scaling)
), ),
" at ", " at (axis cs:$x, $y) {$(val.str)};"
PGFPlotsX.Coordinate(x, y),
"{$(val.str)};"
]) ])
end end