Gadfly - subplot_grid is not readjusting the x axis width for free_x_axis = true, if xlabels are different in subplots

Hello,

This issue is related to using subplot_grid in Gadfly. The issue is, given the xlabels in the two subplots are different due to my data points, even when I do free_x_axis = true, the plot retains the locations of the xlabels filled with empty space. Please help me understand how may I fix this?

Fake Data

df_plot = vcat(
DataFrame(model = repeat([“one”,“two”, “three”],inner=242),
type = repeat([“type1”],outer=726),
data=rand(726))
,
DataFrame(model = repeat([ “four”, “five”, “six”],inner=242),
type = repeat([“type2”],outer=726),
data=rand(726)))

image

Some more information about the data
image

Plot
Here I am not using free_x_axis = true just to show how the plot looks

Gadfly.plot(df_plot,
x=:model,
y=:data,
xgroup = :type,
Geom.subplot_grid(Geom.boxplot),
)

Now, if I use free_x_axis = true, the empty xlabels goes away, but the empty space still remains. Hence, the plot doesn’t look pretty

Thanks for all the help!