From e73f880a112600875ecfa17883f6250e90c9270c Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 5 May 2022 10:01:09 +0200 Subject: [PATCH] make bar workign --- src/axes.jl | 9 +++++++++ src/recipes.jl | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/axes.jl b/src/axes.jl index 974f34b8..14255255 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -675,6 +675,15 @@ end # these methods track the discrete (categorical) values which correspond to axis continuous values (cv) # whenever we have discrete values, we automatically set the ticks to match. # we return (continuous_value, discrete_index) +function discrete_value!(plotattributes, letter::Symbol, dv) + l = if plotattributes[:series_permutation] !== :none + only(filter(!=(letter), plotattributes[:series_permutation])) + else + letter + end + discrete_value!(plotattributes[:subplot][get_attr_symbol(l, :axis)], dv) +end + function discrete_value!(axis::Axis, dv) cv_idx = get(axis[:discrete_map], dv, -1) if cv_idx == -1 diff --git a/src/recipes.jl b/src/recipes.jl index e927d533..944e86cc 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -438,7 +438,7 @@ end procx, procy, xscale, yscale, baseline = _preprocess_barlike(plotattributes, x, y) nx, ny = length(procx), length(procy) axis = plotattributes[:subplot][isvertical(plotattributes) ? :xaxis : :yaxis] - cv = [discrete_value!(axis, xi)[1] for xi in procx] + cv = [discrete_value!(plotattributes, :x, xi)[1] for xi in procx] procx = if nx == ny cv elseif nx == ny + 1