# How do we decide whether to visualize a matrix with its rows or columns?

Should one visualize a matrix by its rows, columns, or both depending on the situation? I see both used and it seems arbitrary. It would be nice if only one was used consistently. Shouldn't a graph of a matrix be denoted as being a row or column representation somehow to avoid confusion?

Example where author switches: https://intuitive-math.club/linear-algebra/matrices

[Example I] Given the transformation: $$\begin{bmatrix} 1 & 1\\ 2 & 0 \end{bmatrix} + \begin{bmatrix} 2 & 1\\ 1 & 1 \end{bmatrix} = \begin{bmatrix} 3 & 2\\ 3 & 1 \end{bmatrix}$$ The author represents the matrix after the transformation visually by its rows, using the following row vectors:

$$v_1 = \begin{bmatrix} 3\\ 2 \end{bmatrix} v_2 = \begin{bmatrix} 3\\ 1 \end{bmatrix}$$ [Example II] Given the transformation: $$\begin{bmatrix} 0 & 1\\ -1 & 0 \end{bmatrix} \begin{bmatrix} 3 & 1\\ 1 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 1\\ -3 & 1 \end{bmatrix}$$

The author represents the matrix after the transformation visually by its columns, using the following column vectors:

$$v_1 = \begin{bmatrix} 1\\ -3 \end{bmatrix} v_2 = \begin{bmatrix} 1\\ -1 \end{bmatrix}$$ Question:

Why is did they author seemingly arbitrarily switch from a row → column visual representation? What is the intuition behind this – if any?

• I love this question! To give you a short, definitive “answer” that isn’t up to par with the expected quality on this site: Most people will default to looking at columns as vectors. If you break it into rows, most people will look at those as equations (as in a system) in multiple variables. Only occasionally do you interpret the rows as vectors—but it’s doable. I hope that helps. – gen-ℤ ready to perish Aug 13 at 2:02
• The real answer here, I think, is that the website you link to isn't choosing its visualizations in any sort of principled way. I wouldn't read anything into the the particular choices made on that site. – Will Orrick Aug 13 at 9:00

There's a lot of ways to interpret matrices, some of which involve reading it by rows and some by columns. But in this particular case, it is columns both times: you were misled by the fact that the matrix $$\begin{bmatrix}3 & 1 \\ 1 & 1\end{bmatrix}$$ is symmetric, so its columns are the same as its rows.

Here, the idea is that for any $$2 \times 2$$ (or more generally $$k \times 2$$) matrix $$A$$, we have $$A \begin{bmatrix}3 & 1 \\ 1 & 1\end{bmatrix} = \begin{bmatrix}A \begin{bmatrix}3 \\ 1\end{bmatrix} & A\begin{bmatrix}1 \\ 1\end{bmatrix} \end{bmatrix}.$$ In other words, each column of the product is equal to $$A$$ times a column of the second matrix we multiplied.

In the picture you have, the vector $$\begin{bmatrix}3 \\ 1\end{bmatrix}$$ (in pink) gets sent to $$\begin{bmatrix}1 \\ -3\end{bmatrix}$$, and the vector $$\begin{bmatrix}1 \\1\end{bmatrix}$$ (in yellow) gets sent to $$\begin{bmatrix}1 \\ -1\end{bmatrix}$$, and all of these are columns of the respective $$2 \times 2$$ matrix.

• You are completely correct. That is my mistake for not noticing the symmetry. I may have to edit my questions example to get the correct point across. – Matthaeus Gaius Caesar Aug 12 at 23:06
• I completely edited the examples in my question. The example was mistakingly symmetric, which took away from the actual question at hand. I do not know if such a large edit is allowed, but the premise of the question remains the same. Should I make a new question with the new example? – Matthaeus Gaius Caesar Aug 12 at 23:07
• @Caesar I think the edit was fine as it’s not altering the question itself. You did the right thing by leaving a comment. The problem with major edits arises when they make an answer obsolete. – gen-ℤ ready to perish Aug 13 at 3:09
• The website's example of matrix addition has an illustration showing a vector $[2 0],$ which can only be a row of one of the matrices, not a column. I think it would have been better if it had said this explicitly. I don't see anything wrong with getting used to matrices being either columns of row vectors or rows of column vectors, but expecting you to guess while you're just learning is a bit much to ask. – David K Aug 13 at 12:05
• @MatthaeusGaiusCaesar, your edit almost completely invalidates this answer. While your question first had the two cases before and after transformation, now it has two different transformations. The sentence at the beginning of this answer "it is columns both times" no longer applies, and makes the answer look out of place. – ilkkachu Aug 13 at 12:17

As long as your main objects of study are column vectors, and you multiply matrix and (column) vector together by writing the matrix on the left and the vector on the right, a matrix is more naturally seen as a collection of columns rather than rows.

A matrix represents a linear transformation. The columns of the matrix are given by where this linear transformation sends your basis vectors. The result of a matrix-vector product similarly becomes a linear combination of the columns of the matrix (where the entries in the vector are the coefficients of this linear combination).

When multiplying two matrices, of course you can choose. Either you say "Apply the left-hand matrix to each column in the right-hand matrix, and collect the results in a new matrix" (in which case you see both matrices as collections of columns), or you say "Apply the right-hand matrix to each row in the left-hand matrix, and collect the results in a new matrix" (in which case both matrices are collections of rows). They both give the same result. Which one is most convenient comes down to whether one happens to be significantly easier to calculate than the other for some reason, and what you're going to do with the result afterwards.

Of course, the final answer is "it depends on the situation". Because what else could it be? But columns is much more common than rows.