@Morten ,
You can easily do that in JMP. If you wanted to do that using a script, here is an example:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb1 = dt << Graph Builder(Variables( X( :sex ), X( :age, Position( 1 ) ), Y( :height ) ),
Elements( Points( X( 1 ), X( 2 ), Y, Legend( 24 ) ) )
);
If you wanted to use the interactive platform, just drop a variable on the x-axis . Then bring the second variable and hover it on the x-axis, JMP will tell you what will happen depending on where you drop it .
Best
Uday