0
$\begingroup$

In the code below, how to make PlotLabel automatically show the name of the data sets (i.e., aa, bb, cc)?

aa = RandomReal[1, {5, 5}];
bb = RandomReal[1, {5, 5}];
cc = RandomReal[1, {5, 5}];
Table[MatrixPlot[data, PlotLabel -> ?? ],{data,{aa,bb,cc}}]
$\endgroup$
  • $\begingroup$ Row[MapThread[ MatrixPlot[#1, PlotLabel -> #2] &, {{aa, bb, cc}, {"aa", "bb", "cc"}}]] ? $\endgroup$ – Xminer Oct 20 at 20:16
  • $\begingroup$ @Xminer Thanks, but this does not extract the names automatically. $\endgroup$ – xiaohuamao Oct 20 at 20:26
  • 3
    $\begingroup$ Column[MatrixPlot[ToExpression@#, PlotLabel -> #] & /@ {"aa", "bb", "cc"}] $\endgroup$ – Bob Hanlon Oct 20 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.