Other examples of use of the IntPic package Varia The following example shows how to produce tikz code for a picture containing the odd integers from 801 to 999. Each line (except the highest) contains 15 cells.
gap> rg := Filtered([801..889],u->(u mod 2)<>0);; gap> flen := 15;; gap> twins := Filtered(Primes, p -> p + 2 in Primes);; gap> arr := [Primes,Union(twins,twins+2),Filtered(rg,u->(u mod 3)=0)];; gap> tkz := IP_TikzArrayOfIntegers(rg,flen,rec(highlights:=arr));;
The picture obtained highlights the primes, the twin primes and the multiples of 3. As the twins are also primes, a gradient is used to highlight them. In this example the default list of colors is used. \begin{center} \includegraphics[width=0.95\textwidth]{../images/primesandtwinsamongodd} \end{center} <br><center><img src="../images/primesandtwinsamongodd.jpg"></center><br> The same computations, but defining other color lists.
gap> cls := IP_ColorsCompRedTones;; gap> rg := Filtered([801..889],u->(u mod 2)<>0);; gap> flen := 15;; gap> twins := Filtered(Primes, p -> p + 2 in Primes);; gap> arr := [Primes,Union(twins,twins+2),Filtered(rg,u->(u mod 3)=0)];; gap> tkz := IP_TikzArrayOfIntegers(rg,flen,rec(colors := cls,highlights:=arr));;
\begin{center} \includegraphics[width=0.95\textwidth]{../images/primesandtwinsamongodd_comp_red} \end{center} <br><center><img src="../images/primesandtwinsamongodd_comp_red.jpg"></center><br>
gap> cls := IP_ColorsDGrayTones;; gap> rg := Filtered([801..889],u->(u mod 2)<>0);; gap> flen := 15;; gap> twins := Filtered(Primes, p -> p + 2 in Primes);; gap> arr := [Primes,Union(twins,twins+2),Filtered(rg,u->(u mod 3)=0)];; gap> tkz := IP_TikzArrayOfIntegers(rg,flen,rec(colors := cls,highlights:=arr));;
\begin{center} \includegraphics[width=0.95\textwidth]{../images/primesandtwinsamongodd_dark_gray} \end{center} <br><center><img src="../images/primesandtwinsamongodd_dark_gray.jpg"></center><br>
gap> cls := ["blue","-blue","black"];; gap> rg := Filtered([801..889],u->(u mod 2)<>0);; gap> flen := 15;; gap> twins := Filtered(Primes, p -> p + 2 in Primes);; gap> arr := [Primes,Union(twins,twins+2),Filtered(rg,u->(u mod 3)=0)];; gap> tkz := IP_TikzArrayOfIntegers(rg,flen,rec( colors := cls,highlights:=arr));;
\begin{center} \includegraphics[width=0.95\textwidth]{../images/primesandtwinsamongodd_other} \end{center} <br><center><img src="../images/primesandtwinsamongodd_other.jpg"></center><br> The following example uses the http://www.fc.up.pt/cmup/mdelgado/numericalsgps NumericalSgps package.
gap> #LoadPackage("numericalsgps"); gap> gap> ns := NumericalSemigroup(11,19,30,42,59);; gap> cls := ShuffleIP_Colors([IP_ColorsGreenTones,IP_ColorsCompBlueTones]);; gap> flen := 20;; gap> #some notable elements gap> arr := [SmallElementsOfNumericalSemigroup(ns), > GapsOfNumericalSemigroup(ns), > MinimalGeneratingSystemOfNumericalSemigroup(ns), > FundamentalGapsOfNumericalSemigroup(ns), > [ConductorOfNumericalSemigroup(ns)], > PseudoFrobeniusOfNumericalSemigroup(ns)];; gap> gap> tkz := IP_TikzArrayOfIntegers(flen,rec(colors := cls,highlights:=arr));;
\begin{center} \includegraphics[width=0.95\textwidth]{../images/numericalsgp_notable} \end{center} <br><center><img src="../images/numericalsgp_notable.jpg"></center><br> Using the default colors \begin{center} \includegraphics[width=0.95\textwidth]{../images/numericalsgp_notable_df_colors} \end{center} <br><center><img src="../images/numericalsgp_notable_df_colors.jpg"></center><br> The banner The code in the following example has been used to produce one possible banner for the homepage of the &IntPic; package. A nice picture to give an idea about the primes less than 10000. Of course, other ranges could be chosen. I warn the user that pictures involving a large amount of data may face the problem of exceeding &TeX; capacity...
gap> row_length := 200;; # the legth of each row gap> columns := 50;; # the number of colums gap> n := row_length*columns; 10000 gap> gap> ##compute the primes less than n gap> # Primes is a GAP variable representing the list of primes less than 1000 gap> mp := Maximum(Primes); 997 gap> newprimes := [];; gap> while mp < n do > mp := NextPrimeInt(mp); > Add(newprimes, mp); > od; gap> small_primes := Union(Primes, newprimes);; gap> ##compute the first element of each pair of twin primes less than n gap> twins := Filtered(small_primes, p -> IsPrime(p+2));; gap> gap> rg := [1..n];; gap> gap> arr := [Intersection(small_primes,rg),[],[], > Intersection(Union(twins,twins+2),rg),[],[],[],[],[],[],[], > [],[],[],[],[],[],Difference(rg,small_primes)];; gap> gap> tkz:=IP_TikzArrayOfIntegers([1..n],row_length,rec(highlights:=arr, > cell_width := "6",colsep:="0",rowsep:="0",inner_sep:="2", > shape_only:=" ",line_width:="0",line_color:="black!20" ));;
\begin{center} \includegraphics[width=0.99\textwidth]{../images/intpic_banner.pdf} \end{center} <br><center><img src="../images/intpic_banner.jpg"></center><br>