# Plot elements of a time dependent matrix

The matrix that I wanna plot the elements are complicated, this matrix is just an example:

matriz[t_] := {{-2*t, 2*(1 - t)*t, 0}, {2*(1 - t)*t, 0, 2*(1 - t)}, {0, 2*(1 - t), 0}};
MatrixForm[matriz[t]]


I want to generate a graph thats show the evolution of each element and the label is the ij of the element

## Some basics first:

1. Try to see if you can extract the matrix element to begin with. You can achieve this by using Part. The most common notation is list[[elem]] which picks out the element of your choice. You can then keep adding components to get to your desired list/matrix depth: list[[row,col]].

2. Try to see if you can Plot anything at all, and then try to plot an element of your matrix.

It can be daunting at first, but you will become very speedy quite fast.

A staple of mathematica is to be familiar with the following very handy guide on List Manipulation. It is arguably the most useful guide there is out there.

## Now back to your question

Table[Plot[Evaluate[matriz[t][[i, j]]], {t, 1, 10},
PlotLabel -> matriz[t][[i, j]]], {i, 1, 3}, {j, 1, 3}] // Grid


## Or, if you prefer to have them all in one graph:

Plot[Evaluate@(Table[
Evaluate[matriz[t]][[i, j]], {i, 1, 3}, {j, 1, 3}]), {t, 1, 10},
PlotLegends -> Flatten@matriz[t]]


Although I am not particularly fond of this plot. Perhaps you could use Callout to better identify the labels on each matrix element? I'll leave that to you.:)

• But how to plot in a single graph? Commented Mar 27, 2023 at 23:58
• I've edited my post. Let me know what you think. take care.
– alex
Commented Mar 28, 2023 at 8:44
• i've added a small section at the start for you. You had a good and useful question. The only thing I would suggsest for your next post is that you show your attempt on the code. This helps the community better understand your way of thinking and perhaps can give you pointers on how to improve. Also, by trying you get much more familiar with your work as well.
– alex
Commented Mar 28, 2023 at 8:57
• Thanks, it worked Commented Mar 28, 2023 at 18:45