If your factors go from 1
to M
and 1
to N
respectively, the simplest would be:
using StatPlots, DataFrames
@df df scatter(:IV, :DV, group = {:Factor1, :Factor2}, layout = (M, N))
For more complex situation I would have thought the following would work and be useful:
plot(layout = (M,N))
by(df, [:Factor1, :Factor2]) do dd
@df dd scatter!(:IV, :DV, subplot = (:Factor1, :Factor2))
end
But fails for technical reasons. Somehow a SubDataFrame
does not have the IterableTables
implementation and our plotting macro can’t handle it, I’ll file an issue.