Skip to main content
1 of 2
kglr
  • 400.5k
  • 18
  • 488
  • 929
arrow = Arrow[{{0, -1/2}, {0, 1/2}}];

ClearAll[arrowTable]
arrowTable[n_, k_, len_, as_, opts : OptionsPattern[] ] := 
 Module[{m = Partition[Join @@ Tuples[{-1, 1}, n], k n]}, 
  Graphics[{Arrowheads[as], Thick, MapIndexed[{RandomColor[], 
       Translate[Scale[arrow, {1, # len}, {0, 0}], {1/3, len} #2]} &, m, {2}]}, 
   opts, GridLines -> {None, len Range[-1/2, k n ]}, 
   Frame -> True, FrameTicks -> None, 
   PlotRangePadding -> {{Scaled[.02], Scaled[.02]}, {0, 0}}, 
   PlotRangeClipping -> False, AspectRatio -> Automatic]]

Examples:

arrowTable[5, 1, 1, .03, ImageSize -> Large]

enter image description here

arrowTable[6, 2, 1, .04, ImageSize -> Large]

enter image description here

kglr
  • 400.5k
  • 18
  • 488
  • 929