Bar: multicategory spacing Just Like in Groups

While using type=‘subcategory’ with plotly, the bars are equally spaced: space between categories and subcategories are same. Is it possible to change this so that there is no space between subcategories and space between categories (just like done when barmode=“group”)?

What I have with type=multicategory:

p<-plot_ly()
x1<-list(c('A1','A2','A3'),c('B1','B1','B1'))
y1<-c(1,5,2)
x2<-list(c('A1','A3'),c('B2','B2'))
y2<-c(9,2)
x3<-list(c('A1','A2'),c('B3','B3'))
y3<-c(2,7)

p<-plot_ly()
p <- add_trace(p, x=x1, y=y1, type='bar',  name = 'B1')
p <- add_trace(p, x=x2, y=y2, type='bar',  name = 'B2')
p <- add_trace(p, x=x3, y=y3, type='bar',  name = 'B3')
p <- layout(p, modebar="group",xaxis=list(anchor='x2',type='multicategory'))
p

Something I would like (but achieved with group)

p<-plot_ly()
x1<-c('A1','A2','A3')
y1<-c(1,5,2)
x2<-c('A1','A2','A3')
y2<-c(9,2,4)
x3<-c('A1','A2','A3')
y3<-c(2,7,1)

p<-plot_ly()
p <- add_trace(p, x=x1, y=y1, type='bar',  name = 'B1')
p <- add_trace(p, x=x2, y=y2, type='bar',  name = 'B2')
p <- add_trace(p, x=x3, y=y3, type='bar',  name = 'B3')
p <- layout(p, barmode="group")
p

I tried a small trick, however, with this approach, I could not offset the bars, so ticks lie betweencategories:

p<-plot_ly()
x1<-list(c('A1','A2','A3'),c('B1','B1','B1'))
y1<-c(1,5,2)
x2<-list(c('A1','A3'),c('B2','B2'))
y2<-c(9,2)
x3<-list(c('A1','A2'),c('B3','B3'))
y3<-c(2,7)
x4<-list(c('A1','A2','A3'),c(' ',' ',' '))
y4<-c(0,0,0)

p<-plot_ly()
p <- add_trace(p, x=x1, y=y1, type='bar',  name = 'B1')
p <- add_trace(p, x=x2, y=y2, type='bar',  name = 'B2')
p <- add_trace(p, x=x3, y=y3, type='bar',  name = 'B3')
p <- add_trace(p, x=x4, y=y4, type='bar', name = 'B4', showlegend=FALSE)
p <- layout(p, bargap=0)
p

How can I achieve different spacing between categories and multicategory in plotly?