在牛虻中使用Geom.subplot_网格时,如何将参数发送到Geom.histogram?

在牛虻中使用Geom.subplot_网格时,如何将参数发送到Geom.histogram?,plot,histogram,julia,gadfly,Plot,Histogram,Julia,Gadfly,我试图为同一个数据集绘制几个柱状图,但有不同数量的箱子。我在用牛虻 假设x只是一个实值数组,绘制每个直方图是可行的: plot(x=x, Geom.histogram(bincount=10)) plot(x=x, Geom.histogram(bincount=20)) 但我想把所有的直方图放在一起。我已将箱子数量作为另一个维度添加到我的数据集: x2 = vcat(hcat(10*ones(length(x)), x), hcat(20*ones(length(x)), x) df = D

我试图为同一个数据集绘制几个柱状图,但有不同数量的箱子。我在用牛虻

假设
x
只是一个实值数组,绘制每个直方图是可行的:

plot(x=x, Geom.histogram(bincount=10))
plot(x=x, Geom.histogram(bincount=20))
但我想把所有的直方图放在一起。我已将箱子数量作为另一个维度添加到我的数据集:

x2 = vcat(hcat(10*ones(length(x)), x), hcat(20*ones(length(x)), x)
df = DataFrame(Bins=x2[:,1], X=x2[:,2])
当使用
Geom.subplot\u grid
时,是否有任何方法将存储箱的数量(第一列的值)发送到
Geom.histogram
?大概是这样的:

plot(df, x="X", ygroup="Bins", Geom.subplot_grid(Geom.histogram(?)))

我认为您最好不要在那个时候使用子地块网格,而只是将它们与vstack或hstack结合起来。从文件中

Plots can also be stacked horizontally with ``hstack`` or vertically with 
``vstack``. This allows more customization in regards to tick marks, axis 
labeling, and other plot details than is available with ``subplot_grid``.