Mathematica Is it possible to colour the rows or columns of a matrix?

AI Thread Summary
It is possible to color the rows or columns of a matrix in Mathematica using specific styling functions. The user shared a code snippet that utilizes Rasterize and Style to format a matrix. They seek clarification on whether their approach aligns with the desired outcome of coloring matrix elements. A reference link to Wolfram's tutorial on tables and matrices was provided for additional guidance. The discussion emphasizes the importance of proper styling techniques in Mathematica for visual representation.
piJohn1411
Messages
1
Reaction score
0
Hi,

I was wondering if it's possible to colour the rows and columns of a matrix in mathematica.

I have received help from another forum and the code of my matrix is the following:

Rasterize@
Style[MatrixForm[{{n, -1 + n, -2 + n, \[CenterEllipsis], 1}, {2 n,
2 n - 1, 2 n - 2, \[CenterEllipsis], n + 1}, {3 n, 3 n - 1,
3 n - 2, \[CenterEllipsis],
2 n + 1}, {\[VerticalEllipsis], \[VerticalEllipsis], \
\[VerticalEllipsis], \[DescendingEllipsis], \[VerticalEllipsis]}, \
{n^2, -1 + n^2, -2 + n^2, \[CenterEllipsis],
HoldForm[(n - 1) n + 1]}},
TableAlignments -> {Center, Center}] // TraditionalForm, 30]

Thank you for your help.
 
Physics news on Phys.org

Similar threads

Replies
5
Views
2K
Replies
2
Views
1K
Replies
8
Views
2K
Replies
10
Views
3K
Replies
5
Views
3K
Replies
2
Views
2K
Replies
18
Views
4K
Replies
12
Views
5K
Back
Top