From 94e6427befef28433bdc0dbc23d4adaa543e47aa Mon Sep 17 00:00:00 2001 From: Fabian Greimel Date: Tue, 16 Oct 2018 22:48:43 +0200 Subject: [PATCH] Improving ggplot2 theme --- src/ggplot2.jl | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/ggplot2.jl b/src/ggplot2.jl index c071fe6..0c4b87a 100644 --- a/src/ggplot2.jl +++ b/src/ggplot2.jl @@ -23,14 +23,42 @@ # fglegend = :lightgray, # fgguide = :black) +const _ggplot_colors = Dict( + :gray92 => RGB(fill(0.92, 3)...), + :gray20 => RGB(fill(0.2, 3)...), + :gray30 => RGB(fill(0.3, 3)...) + ) + + _themes[:ggplot2] = PlotTheme( + ## Background etc bg = :white, - bginside = :lightgray, - bglegend = plot_color(:lightgray, 0.8), - framestyle = :grid, - gridcolor = :white, - gridalpha = 1, - fgtext = :grey, + bginside = _ggplot_colors[:gray92], + bglegend = _ggplot_colors[:gray92], fglegend = :white, fgguide = :black, -) + widen=true, + ## Axes / Ticks + #framestyle = :grid, + #foreground_color_tick = _ggplot_colors[:gray20], # tick color not yet implemented + foreground_color_axis = _ggplot_colors[:gray20], # tick color + tick_direction=:out, + foreground_color_border =:white, # axis color + foreground_color_text = _ggplot_colors[:gray30], # tick labels + gridlinewidth = 1, + #tick label size = *0.8, + ### Grid + foreground_color_grid = :white, + gridalpha = 1, + ### Minor Grid + minorgrid = true, + minorgridalpha = 1, + minorgridlinewidth=0.5, # * 0.5 + foreground_color_minor_grid=:white, + #foreground_color_minortick=:white, ## not yet implemented + minorticks = 2, + ## Lines and markers + markerstrokealpha = 0, + markerstrokewidth = 0 + #showaxis= :false + )