From 4486620918f66549a9ed01353268ae96a12f3fef Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 19 Nov 2019 11:30:34 +0100 Subject: [PATCH] title styling --- src/backends/pgfplotsx.jl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index c38f11a3..c3e13709 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -56,7 +56,7 @@ const _pgfx_annotation_halign = KW( # TODO: maybe obsolete function pgfx_colormap(grad::ColorGradient) join(map(grad.colors) do c - @sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c),blue(c)) + @sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c), blue(c)) end,"\n") end @@ -451,14 +451,26 @@ function _update_plot_object(plt::Plot{PGFPlotsXBackend}) end cstr = plot_color(sp[:background_color_legend]) a = alpha(cstr) + title_cstr = plot_color(sp[:titlefontcolor]) + title_a = alpha(cstr) + # TODO: aspect ratio, legend position axis_opt = PGFPlotsX.Options( "height" => string(height(bb)), "width" => string(width(bb)), "title" => sp[:title], + "title style" => PGFPlotsX.Options( + "font" => pgfx_font(sp[:titlefontsize], pgfx_thickness_scaling(sp)), + "color" => title_cstr, + "draw opacity" => title_a, + "rotate" => sp[:titlefontrotation] + ), "legend style" => PGFPlotsX.Options( - pgfx_linestyle(pgfx_thickness_scaling(sp), sp[:foreground_color_legend], 1.0, "solid") => nothing, - "fill" => cstr, - "font" => pgfx_font(sp[:legendfontsize], pgfx_thickness_scaling(sp)) + pgfx_linestyle(pgfx_thickness_scaling(sp), sp[:foreground_color_legend], 1.0, "solid") => nothing, + "fill" => cstr, + "font" => pgfx_font(sp[:legendfontsize], pgfx_thickness_scaling(sp)) + ), + "axis background/.style" => PGFPlotsX.Options( + "fill" => sp[:background_color_inside] ) ) for letter in (:x, :y, :z)