Merge pull request #2581 from daschw/pgfplotsx

add legendtitle for pgfplotsx
This commit is contained in:
Daniel Schwabeneder 2020-04-15 10:53:08 +02:00 committed by GitHub
commit ef36c6bd0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,7 @@
name = "Plots"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
author = ["Tom Breloff (@tbreloff)"]
version = "1.0.9"
version = "1.0.10"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

View File

@ -240,6 +240,16 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
PGFPlotsX.Axis
end
axis = axisf(axis_opt)
if sp[:legendtitle] !== nothing
push!(axis, PGFPlotsX.Options("\\addlegendimage{empty legend}" => nothing))
push!(
axis,
PGFPlotsX.LegendEntry(
string("\\hspace{-.6cm}{\\textbf{", sp[:legendtitle], "}}"),
false,
),
)
end
for (series_index, series) in enumerate(series_list(sp))
# give each series a uuid for fillbetween
series_id = uuid4()