change input to optimize_ticks for log scales

This commit is contained in:
Daniel Schwabeneder 2021-06-11 18:10:24 +02:00
parent 3f5a1287be
commit 95d6cf518e

View File

@ -174,6 +174,11 @@ function optimal_ticks_and_labels(ticks, alims, scale, formatter)
sf(amax); sf(amax);
k_min = 4, # minimum number of ticks k_min = 4, # minimum number of ticks
k_max = 8, # maximum 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] )[1]
elseif typeof(ticks) <: Int elseif typeof(ticks) <: Int
scaled_ticks, viewmin, viewmax = optimize_ticks( 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 # `strict_span = false` rewards cases where the span of the
# chosen ticks is not too much bigger than amin - amax: # chosen ticks is not too much bigger than amin - amax:
strict_span = false, 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)) # axis[:lims] = map(RecipesPipeline.inverse_scale_func(scale), (viewmin, viewmax))
else else