Given data in the form
list={{{1,2},{3,4},{5,6}},{{7,8},{9,10},{11,12}},...}
a matrix where elements are 2-element vectors, what is a efficient way to plot this as a spatial grid? As I understand
ArrayPlot[array,ColorFunction->(If[#>3,Red,White]&), ColorFunctionScaling->False]
can only be "fed" with normal array (no 2-vector like above), if you want to use Colorfunction If condition.
I want that a cell of the ArrayPlot mesh gets Red, when in {x,y} vector 1<x<2 AND y>3
, otherwise White.
I know I could recreate the list into a {{1,0,1},{0,1,0},...} like normal array so ArrayPlot could read it, by using Table and Take, 1 and 0 representing the Red and White Case:
If[1<First[Flatten[Take[list,i]]]<2,1,0]
Then rebuild that list with Table and Join. But as far as I know MM, there has to be easier way, simply reading list and replacing a 2-vector with 1 or 0 1-vector under above conditions. Or do I really have to build the list completely new, problem is it has some million elements.
Thanks for any tips to improve this
Map[(*your converting function*), list, {2}]
. $\endgroup$