1
$\begingroup$

In a previous post I asked for the possibility to have a binary image of the coprimality inside the natural numbers. The following code

     TableForm[
     table = Table[Boole[CoprimeQ[m, n]], {m, 13}, {n, 13}],
     TableHeadings -> {Range[13], Range[13]}] 

together with

     table == Table[Boole[GCD[m, n] == 1], {m, 13}, {n, 13}]

     (* True *)

     ArrayPlot[table, FrameTicks -> {Range[13], Range[13]}]

provides the following the result

enter image description here

Unfortunately, I need a plot as given below.

enter image description here

The problem is that the vertical axis should go from 1 to 13 and not vice versa. Any idea or tip?

$\endgroup$
  • 1
    $\begingroup$ Reverse.....? $\endgroup$ – Henrik Schumacher Dec 31 '18 at 23:33
3
$\begingroup$

Use the option DataReversed:

ArrayPlot[table, Frame -> True, FrameTicks -> {Range[13], Range[13]}, 
 DataReversed -> True, Mesh -> All]

enter image description here

table2 = Table[Boole[And @@ PrimeQ[{m, n}]], {m, 13}, {n, 13}];
ArrayPlot[table2, Frame -> True, FrameTicks -> {Range[13], Range[13]}, 
   DataReversed -> True, Mesh -> All]

enter image description here

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.