Using the group
keyword argument in Statsplots.boxplot
adjusts the distance between individual boxes so that they cluster with their groups (see example below):
using StatsPlots
x = Vector{String}(undef, 40)
for i = 1:40
if i % 4 == 0
x[i] = "E"
elseif i % 4 == 1
x[i] = "A"
elseif i % 4 == 2
x[i] = "B"
elseif i % 4 == 3
x[i] = "C"
end
end
is_vowel(x) = x == "A" || x == "E" ? "vowel" : "consonant"
boxplot(x, rand(40), group=is_vowel.(x))
Any idea how to disable this behaviour? In my use-case I have three boxes, but want to colour each according to one of two groups - 2 in one, 1 in the other. This asymmetry in distance between boxes makes the plot look really ugly.