From 7bf89d86141e4f3c9629fd5138f7053755daab2d Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 21 Nov 2019 16:46:15 +0100 Subject: [PATCH] subplot annotations --- src/backends/pgfplotsx.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 33a2d98a..325d1047 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -18,6 +18,7 @@ function Base.push!(pgfx_plot::PGFPlotsXPlot, item) end function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) + # TODO: annotations! does not trigger _series_added ... if !pgfx_plot.is_created cols, rows = size(plt.layout.grid) the_plot = PGFPlotsX.TikzPicture() @@ -180,6 +181,11 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) pgfx_add_annotation!(axis, xi, yi, PlotText(str, fnt), pgfx_thickness_scaling(series)) end end + # add subplot annotations + anns = sp.attr[:annotations] + for (xi,yi,txt) in anns + pgfx_add_annotation!(axis, xi, yi, txt) + end end if ispolar(sp) axes = the_plot