From 95d6cf518ecce6c121278eed4d9fb8ed92a1e61e Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 11 Jun 2021 18:10:24 +0200 Subject: [PATCH] change input to `optimize_ticks` for log scales --- src/axes.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/axes.jl b/src/axes.jl index 647c4b2c..fe745e8f 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -174,6 +174,11 @@ function optimal_ticks_and_labels(ticks, alims, scale, formatter) sf(amax); k_min = 4, # minimum number of ticks k_max = 8, # maximum number of ticks + Q = if scale in _logScales + [(1.0,1.0), (5.0, 0.9), (2.0, 0.7)] + else + [(1.0,1.0), (5.0, 0.9), (2.0, 0.7), (2.5, 0.5), (3.0, 0.2)] + end, )[1] elseif typeof(ticks) <: Int scaled_ticks, viewmin, viewmax = optimize_ticks( @@ -185,6 +190,11 @@ function optimal_ticks_and_labels(ticks, alims, scale, formatter) # `strict_span = false` rewards cases where the span of the # chosen ticks is not too much bigger than amin - amax: strict_span = false, + Q = if scale in _logScales + [(1.0,1.0), (5.0, 0.9), (2.0, 0.7)] + else + [(1.0,1.0), (5.0, 0.9), (2.0, 0.7), (2.5, 0.5), (3.0, 0.2)] + end, ) # axis[:lims] = map(RecipesPipeline.inverse_scale_func(scale), (viewmin, viewmax)) else