Merge pull request #2295 from BeastyBlacksmith/pgfplotsx

fix fillrange legends
This commit is contained in:
Daniel Schwabeneder 2019-12-03 14:03:23 +01:00 committed by GitHub
commit e04858c975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
using Contour: Contour using Contour: Contour
Base.@kwdef mutable struct PGFPlotsXPlot Base.@kwdef mutable struct PGFPlotsXPlot
is_created::Bool = false is_created::Bool = false
was_shown::Bool = false was_shown::Bool = false
@ -249,7 +248,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
PGFPlotsX.print_tex(io, pgfx_fillstyle(opt, i)) PGFPlotsX.print_tex(io, pgfx_fillstyle(opt, i))
style = strip(String(take!(io)),['[',']', ' ']) style = strip(String(take!(io)),['[',']', ' '])
push!( segment_opt, "legend image code/.code" => """{ push!( segment_opt, "legend image code/.code" => """{
\\draw[##1,/tikz/.cd, $style] (0cm,-0.1cm) rectangle (0.6cm,0.1cm); \\draw[$style] (0cm,-0.1cm) rectangle (0.6cm,0.1cm);
}""" ) }""" )
end end
end end