I need to have some customization in my bar plots, and was wondering if someone could help me achieve the following two things:
- How to specify different widths to different stacks in the bar plot? For example, in the plot below, I want the width as follows
left = 0.7
,middle = 0.9
,right = 1.3
,extra = 0.5
. - How to write some numbers over each stack. For example, how to write say
2.0
overleft
stack,3.0
overright
stack, and so on?
Code:
using CairoMakie
tbl = (
x = [1, 2, 3, 4, 1, 2, 3, 4],
height = [10,15,20,25,12,17,23,30],
grp = [1,1,1,1,2,2,2,2],
)
barplot(tbl.x, tbl.height;
dodge = tbl.grp,
color = 1:8,
axis = (xticks = (1:4, ["left", "middle", "right", "extra"]),
title = "Dodged bars"))
Thanks!