Replace x (resp. y) by column_index (resp. row_index) when relevant