Group Abstract Group Abstract

Message Boards Message Boards

How to use MatrixPlot dynamically?

Posted 11 years ago

Hi,

I am trying to plot a matrix with MatrixPlot[]. Whenever a value in the matrix changes, MatrixPlot[] should reflect this change graphically. I am using this code:

Dynamic[
 For[i = 1, i < 1000, i++, 
  matrix = Table[RandomReal[{0, 10}], {i, 1, 10}, {j, 1, 10}]]; 
 MatrixPlot[matrix, ColorFunction -> ColorData["Rainbow"]]]

However, I am not sure whether this method stays suitable, if the number of instructions within the Dynamic[] brackets increases. Does anybody know another way for a faster graphical response? Is there a way to specify the dynamic effect only to MatrixPlot[] without having to include the whole code with it?

Thanks Saf

POSTED BY: Saf Al
2 Replies
Posted 11 years ago

Hi Nasser,

Both suggested methods worked perfectly. Thanks so much for your fast reply.

Regards

POSTED BY: Saf Al
POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard