For solving the first problem:
If you filter your data just keeping e.g. a graph with GroupX=1, GroupY=1 and another graph with GroupX=2,GroupY=2, you will indeed still see a 2x2 matrix of graphs with x=1,2 , x=1,2 with just position 1/1 and 2/2 containing a graph and the other 2 positions empty.
If you don't care where the individual plots show up, then you could remove the white regions by
- combining the columns used for GroupX and GroupY to a single column (get still the required intersections)
- use this column as Wrap
On the other hand, this example also shows the disadvantage:
you lose the information about the specific X and Y value.
From daily work in Data Visualization, I know:
There are definitely cases where the benefit of the denser packing overweights the disadvantage of the lost structure
Especially when the generated Matrix has to fit into a Powerpoint slide ...
related topic: X group: restrict the values on the axis to the respective group
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Variables(
X( :height ),
Y( :weight ),
Group X( :age ),
Group Y( :sex ),
Overlay( :sex )
),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter(
Add Filter(
columns( :age, :sex ),
Where( :age == 12 ),
Where( :sex == "F" )
),
Add Filter(
columns( :age, :sex ),
Where( :age == 15 ),
Where( :sex == "M" )
),
Add Filter(
columns( :age, :sex ),
Where( :age == 17 ),
Where( :sex == "F" )
)
)
);
New Column( "Concatenate[age,sex]",
Character,
Formula( Char( :age ) || "_" || :sex ),
);
Graph Builder(
Variables(
X( :height ),
Y( :weight ),
Group X( :"Concatenate[age,sex]"n ),
Overlay( :sex )
),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter(
Add Filter(
columns( :"Concatenate[age,sex]"n ),
Where( :"Concatenate[age,sex]"n == {"12_F", "15_M", "17_F"} )
)
)
)