From 9c1b30f774258b98614feaede6dea50d1184d4fb Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 15 Apr 2020 10:35:29 +0200 Subject: [PATCH 1/2] add legendtitle for pgfplotsx --- src/backends/pgfplotsx.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 2e889f0e..ed5f0972 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -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() From a64d84ae70a6144f7e4f9800abafdac1140e9fee Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 15 Apr 2020 10:36:25 +0200 Subject: [PATCH 2/2] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0ba7d86d..077cc30b 100644 --- a/Project.toml +++ b/Project.toml @@ -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"