Let's say I want to generate a graph to illustrate the ratio of flights with >100min delay, split by airline and separate graphs for the different days of a week and the days of the month.
As there is just a single "color" slot, I can just use the ratio per week OR the ratio per month as color - therefore, the other plot is always nonsense.
There are 2 legends which allow me to adjust the color ranges and gradient settings separately for both subplots, but I couldn't find the knob which allowed me to select two different columns for the color of the two plots.
How can I create a plot in Graph Builder where both subplots show the correct values?
dt = Open( "$SAMPLE_DATA/Airline Delays.jmp" );
dt << New Column( "ratio_week",
Formula( Col Number( If( :Arrival Delay > 100, 1, . ), :Airline, :Day of Week ) / Col Number( 1, :Airline, :Day of Week ) )
);
dt << New Column( "ratio_month",
Formula( Col Number( If( :Arrival Delay > 100, 1, . ), :Airline, :Day of Month ) / Col Number( 1, :Airline, :Day of Month ) )
);
dt << Graph Builder(
Size( 600, 557 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :Airline ),
Y( :Day of Month ),
Y( :Day of Week ),
Color( :ratio_month )
),
Elements( Position( 1, 1 ), Heatmap( X, Y, Legend( 5 ) ) ),
Elements( Position( 1, 2 ), Heatmap( X, Y, Legend( 6 ) ) ),
Column Switcher(
:ratio_month,
{:ratio_week, :ratio_month},
Retain Axis Settings( 1 )
)
)