From 318ae94552e1a59f0d2df9dd85bcdcc29b682727 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Mon, 18 Oct 2021 15:49:58 +0200 Subject: [PATCH] fix rebase woes --- src/backends/gr.jl | 3 +-- src/backends/pgfplotsx.jl | 4 +++- src/backends/unicodeplots.jl | 2 +- src/consts.jl | 28 ++++++++++++++++++++-------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 67c0b5cd..4ab6bf60 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1236,8 +1236,7 @@ function gr_legend_pos(theta::Real, leg, viewport_plotarea; axisclearance = noth end function gr_get_legend_geometry(viewport_plotarea, sp) - legendn = 0 - legendw = 0 + legendn = legendw = dy = 0 if sp[:legend_position] != :none GR.savestate() GR.selntran(0) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 5ff71681..58169b59 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -1235,7 +1235,9 @@ end function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter) axis = sp[get_attr_symbol(letter, :axis)] -# turn off scaled ticks + # turn off scaled ticks + push!(opt, "scaled $(letter) ticks" => "false", string(letter, :label) => axis[:guide]) + tick_color = plot_color(axis[:foreground_color_axis]) push!( opt, "$(letter) tick style" => diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index 21c44b47..448cebdf 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -54,7 +54,7 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend}) o = UnicodePlots.Plot(x, y, _canvas_map[canvas_type]; kw...) for series in series_list(sp) - addUnicodeSeries!(o, series.plotattributes, sp[:legend_position] != :none, xlim, ylim) + o = addUnicodeSeries!(sp, o, kw, series, sp[:legend_position] != :none) end for ann in sp[:annotations] diff --git a/src/consts.jl b/src/consts.jl index c09177d8..663b4acc 100644 --- a/src/consts.jl +++ b/src/consts.jl @@ -5,14 +5,26 @@ const _initial_defaults = deepcopy(_all_defaults) const _initial_axis_defaults = deepcopy(_axis_defaults) # to be able to reset font sizes to initial values -const _initial_fontsizes = Dict( +const _initial_plt_fontsizes = + Dict(:plot_titlefontsize => _plot_defaults[:plot_titlefontsize]) + +const _initial_sp_fontsizes = Dict( :titlefontsize => _subplot_defaults[:titlefontsize], - :legend_font_pointsize => _subplot_defaults[:legend_font_pointsize], - :legend_title_font_pointsize => _subplot_defaults[:legend_title_font_pointsize], - :tickfontsize => _axis_defaults[:tickfontsize], + :legendfontsize => _subplot_defaults[:legend_font_pointsize], + :legendtitlefontsize => _subplot_defaults[:legend_title_font_pointsize], + :annotationfontsize => _subplot_defaults[:annotationfontsize], + :colorbar_tickfontsize => _subplot_defaults[:colorbar_tickfontsize], + :colorbar_titlefontsize => _subplot_defaults[:colorbar_titlefontsize], +) + +const _initial_ax_fontsizes = Dict( + :tickfontsize => _axis_defaults[:tickfontsize], :guidefontsize => _axis_defaults[:guidefontsize], ) +const _initial_fontsizes = + merge(_initial_plt_fontsizes, _initial_sp_fontsizes, _initial_ax_fontsizes) + const _internal_args = [:plot_object, :series_plotindex, :markershape_to_add, :letter, :idxfilter] @@ -23,10 +35,10 @@ const _plot_args = sort(union(collect(keys(_plot_defaults)))) const _magic_axis_args = [:axis, :tickfont, :guidefont, :grid, :minorgrid] const _magic_subplot_args = [ - :titlefont, - :legendfont, - :legend_titlefont, - :plot_titlefont, + :title_font, + :legend_font, + :legend_title_font, + :plot_title_font, :colorbar_titlefont, ] const _magic_series_args = [:line, :marker, :fill]