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$
  • 2
    $\begingroup$ Reverse.....? $\endgroup$ – Henrik Schumacher Dec 31 '18 at 23:33
  • 3
    $\begingroup$ I rolled back your latest edit that removed the contents of your question. Since somebody put in effort to answer your question, you should leave it intact so their answer makes sense. $\endgroup$ – MarcoB Mar 18 at 13:32
6
$\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 agree to our terms of service, privacy policy and cookie policy

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