3

In the following diagram, I would like to insert a key explaining the notation used for the vertices.

In each step of the expanding simple graphs,
the vertices are labeled with a fraction and
an \textit{a}-label. The fraction is a Farey
Fraction; it is typeset above each vertex.

It is a rather length description. I would like to put it somewhere close to the upper right corner of the diagram, and I would like it framed.

Here is the code.

\documentclass[10pt]{amsart}
\usepackage{amssymb}
\usepackage{mathtools,array}

\usepackage{tikz}
\usetikzlibrary{calc,intersections,arrows.meta,bending}


\usepackage{pgfplots}
\pgfplotsset{compat=1.11}


\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}



\begin{document}



\centerline{\Large{\textbf{\textit{a}-Labels and Mediants for a Simple Graph}}} \vskip0.3in


\noindent \hspace*{\fill}
\begin{tikzpicture}[nodes={inner sep=0, font=\scriptsize,
execute at begin node={\setlength\abovedisplayskip{0.75ex}%
\setlength\belowdisplayskip{0.5ex}%
\setlength\abovedisplayshortskip{0.75ex}%
\setlength\belowdisplayshortskip{0.5ex}}},
shorten/.style={shorten >=#1,shorten <=#1},
pics/fpic/.style={code={#1}}, x=1.5cm, y=1.5cm]

%A sequence of graphs is drawn, starting with the vertex with the b-label b.

\matrix[row sep=4.5em]{%<--- This defines the difference between pictures.
%Here is the blow-up of the vertex labeled b.
\pic{fpic={%
\draw[fill] (-4,0) circle (1.5pt);
\node[anchor=north] (label_for_Vertex_b) at ($(-4,0) +(0,-0.25)$){\textit{a}};
\node[anchor=south] at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
}};\\
%
%
\pic{fpic={%
\draw (-4,0) -- (-2,0) coordinate(lcompare);
\draw[fill] (-4,0) circle (1.5pt);
\draw[fill] (-2,0) circle (1.5pt);
%
\node[anchor=north] (bcompare) at ($(-4,0) +(0,-0.25)$){\textit{a}};
\node[anchor=south] (label_for_Farey_Fraction_at_Vertex_b) at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] (label_for_Vertex_b-1) at ($(-2,0) +(0,-0.25)$){$a+1$};
\node[anchor=south] at ($(-2,0) +(0,0.25)$){$\dfrac{1}{1}$};
}}; \\
%
%
\pic{fpic={%
%Here is the blow-up of the vertex labeled b-1.
\draw (-4,0) -- (-2,0) -- (0,0);
\draw[fill] (-4,0) circle (1.5pt);
\draw[fill] (-2,0) circle (1.5pt);
\draw[fill] (0,0) circle (1.5pt);
%
\node[anchor=north] at ($(-4,0) +(0,-0.25)$){\textit{a}};
\node[anchor=south] at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,0) +(0,-0.25)$){$a+1$};
\node[anchor=south] (label_for_Farey_Fraction_at_Vertex_b-1) at ($(-2,0) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] (label_for_Vertex_b-2) at ($(0,0) +(0,-0.25)$){$a+2$};
\node[anchor=south] at ($(0,0) +(0,0.25)$){$\dfrac{2}{1}$};
}}; \\
%
%
\pic{fpic={
%Here is the blow-up of the vertex labeled b-n.
\draw (-4,0) -- (-2,0) -- (0,0) (2,0) -- (5,0);
\draw[fill] (-4,0) circle (1.5pt);
\draw[fill] (-2,0) circle (1.5pt);
\draw[fill] (0,0) circle (1.5pt);
\node (first_ellipses) at (1,0){$\ldots$};
\coordinate (tail_for_bent_arrow_below_first_ellipses) at ($(first_ellipses) +(0,-0.25)$);
\draw[fill] (2,0) circle (1.5pt);
\draw[fill] (5,0) circle (1.5pt);
%
\node[anchor=north] at ($(-4,0) +(0,-0.25)$){\textit{a}};
\node[anchor=south] at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,0) +(0,-0.25)$){$a+1$};
\node[anchor=south] at ($(-2,0) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(0,0) +(0,-0.25)$){$a+2$};
\node[anchor=south] at ($(0,0) +(0,0.25)$){$\dfrac{2}{1}$};
%
\node[anchor=south] (label_for_phantom_Farey_Fraction_at_ellipses) at ($(1,0) +(0,0.25)$){\hphantom{$\dfrac{1}{1}$}};
\coordinate (point_just_above_node_containing_phantom_Farey_Fraction) at ($(label_for_phantom_Farey_Fraction_at_ellipses.north) +(0,0.1)$);
%
\node[anchor=north] at ($(2,0) +(0,-0.25)$){$a+n$};
\node[anchor=south] at ($(2,0) +(0,0.25)$){$\dfrac{n}{1}$};
%
\node[anchor=north] at ($(5,0) +(0,-0.25)$){$a+(n+1)$};
\node[anchor=south] at ($(5,0) +(0,0.25)$){$\dfrac{n+1}{1}$};
%
%
}}; \\
\pic{fpic={
%Here is the vertex placed at the broken edge.
\draw (-4,0) -- (-2,0) -- (0,0) (2,0) -- (5,0);
\draw[fill] (-4,0) circle (1.5pt);
\draw[fill] (-2,0) circle (1.5pt);
\draw[fill] (0,0) circle (1.5pt);
\node (second_ellipses) at (1,0){$\ldots$};
\coordinate (head_for_bent_arrow_above_second_ellipses) at ($(second_ellipses) +(0,0.75)$);
\draw[fill] (2,0) circle (1.5pt);
\draw[fill] ({(2+5)/2},0) circle (1.5pt);
\draw[fill] (5,0) circle (1.5pt);
%
\node[anchor=north] at ($(-4,0) +(0,-0.25)$){\textit{a}};
\node[anchor=south] at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,0) +(0,-0.25)$){$a+1$};
\node[anchor=south] at ($(-2,0) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(0,0) +(0,-0.25)$){$a+2$};
\node[anchor=south] at ($(0,0) +(0,0.25)$){$\dfrac{2}{1}$};
%
\node[anchor=north] at ($(2,0) +(0,-0.25)$){\textit{$a+n$}};
\node[anchor=south] at ($(2,0) +(0,0.25)$){$\dfrac{n}{1}$};
%
\node[anchor=north] at ($(5,0) +(0,-0.25)$){$a+(n+1)$};
\node[anchor=south] at ($(5,0) +(0,0.25)$){$\dfrac{n+1}{1}$};
%
%A "pin" is drawn between the midpoint of the edge between the last two vertices and its label.
\draw[draw=gray, line width=0.8pt, shorten <=1mm, shorten >=1mm] ({(2+5)/2},0) -- ({(2+5)/2},-1);
\node[anchor=north] at ({(2+5)/2},-1){$2a+(2n+1)$};
\node[anchor=south] (f2n) at ($({(2+5)/2},0) +(0,0.25)$){$\dfrac{2n+1}{2}$};
}};\\
};
%
%
%
%
%Arrows are drawn between the diagrams.
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b) to[bend right=30] node[midway, right=1.5mm, align=center]
{Blow-up of\\vertex \textit{b}} (label_for_Farey_Fraction_at_Vertex_b);
%
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b-1) to[bend right=30] node[midway, right=1.5mm, align=center]
{Blow-up of\\vertex $b - 1$} (label_for_Farey_Fraction_at_Vertex_b-1);
%
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b-2) to[bend right=30] node[pos=1/3, right=1.5mm, align=center]
{Blow-up of more\\\hphantom{\ }vertices} (point_just_above_node_containing_phantom_Farey_Fraction);
%
%\draw[-latex, line width=0.8pt, shorten <=30pt, shorten >=7.5pt](label_for_Edge.south) -- (f2n.north);
\draw[-latex, line width=0.8pt, shorten <=7.5pt, shorten >=7.5pt] (tail_for_bent_arrow_below_first_ellipses) to[bend right=30]
(head_for_bent_arrow_above_second_ellipses);

\end{tikzpicture}
\hspace{\fill}


\end{document}
  • @Schrödinger's cat This one has your name all over it. Ha! Ha! May you also tell me why the tail of the last bent arrow looks closer to the penultimate graph than the tails of the other bent arrows are to the graphs preceding them? – user74973 Feb 23 at 18:18
5

Before \end{tikzpicture} insert the following:

\node[draw, text width=0.25\linewidth,inner sep=2mm,align=left,
      below left] at (current bounding box.north east)
    {In each step of the expanding simple graphs,
the vertices are labeled with a fraction and
an \textit{a}-label. The fraction is a Farey
Fraction; it is typeset above each vertex.
};

enter image description here

Addendum: Of topic, regarding your bend arrow indicating vertex blow-up, I would rather draw them as straight arrow. Also your image code (which work well) I would rather based on the answer on your question consistency in drawing bend arrows. You may liked this solution (which is quite different from your approach but according to my opinion more concise):

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{chains,           % new
                positioning,      % new
                quotes}           % new
\makeatletter
\tikzset{% for discontinuing of chain
  off chain/.code={\def\tikz@lib@on@chain{}}%
}
\makeatother

\begin{document}
    \begin{tikzpicture}[auto,
           node distance = 22mm and 21mm,    % new
             start chain = going right,     % new
every edge quotes/.style = {auto=right, font=\footnotesize,
                            align=center},  % new
every edge/.append style = {draw=gray, -latex, line width=1.6pt, shorten >=2pt, shorten <=2pt},
      every label/.style = {inner sep= 2pt,font=\footnotesize},
         dot/.style args = {#1/#2/#3/#4}{circle, draw, fill, minimum size=3pt,
                            inner sep=0pt, outer sep=0pt, anchor=center,
                            label={[name=#1]$#2$},
                            label={[name=#3]below:$#4$},
                            node contents={},
                            on chain}, %
                    ]
%%%% 1. row (is on the top of image), node name is n11
\node (n11) [dot=n11a/\frac{0}{1}/n11b/a];
%%%% 2. row, nodes names are n21, n22
\node (n21) [dot=n21a/\frac{0}{1}/n21b/a,
            below=of n11];
\node (n22) [dot=n22a/\frac{1}{1}/n22b/a+1];
\draw[-latex, line width=0.8pt]
        (n11b) edge["blow up\\ of vertex $b$" '] (n21a);
\draw   (n21) -- (n22);
%%%% 3. row, nodes names are n31, n32, ...
\node (n31) [dot=n31a/\frac{0}{1}/n31b/a,
            below=of n21];
\node (n32) [dot=n32a/\frac{1}{1}/n32b/a+1];
\node (n33) [dot=n33a/\frac{2}{1}/n33b/a+2];
\draw   (n22b) edge["blow up\\  of vertex $b$" '] (n32a);
\draw   (n31) -- (n33);
%%%% 4. row, nodes names are n41, n42, ...
\node (n41) [dot=n41a/\frac{0}{1}/n41b/a,
            below=of n31];
\node (n42) [dot=n42a/\frac{1}{1}/n42b/a+1];
\node (n43) [dot=n43a/\frac{2}{1}/n43b/a+2];
\node (n44) [dot=n45a/\frac{n}{1}/n45b/a+n];
\node (n45) [dot=n46a/\frac{n+1}{1}/n46b/a+(n+1)];
\path   (n43) -- node (n46) {$\dots$} (n44);
\draw   (n33b) edge["Blow up of\\ more vertices" '] (n46);
\draw[thick]    (n41) -- (n43)   (n44) -- node (aux) {} (n45);
%%%% 5. row, nodes names are n51, n52, ...
\node (n51) [dot=n51a/\frac{0}{1}/n41b/a,
            below=of n41 |- aux];
\node (n52) [dot=n52a/\frac{1}{1}/n52b/a+1];
\node (n53) [dot=n53a/\frac{2}{1}/n53b/a+22];
\node (n54) [dot=n54a/\frac{n}{1}/n54b/a+n];
\node (n55) [dot=n55a/\frac{n+1}{1}/n55b/a+(n+1)];
%
\path   (n53) -- node [anchor=center] (n56) {$\dots$} (n54);
\draw   (n46) edge    (n56);
\draw[thick]    (n51) --  (n53)
                (n54) --  (n55) node (n57) [pos=0.5, off chain,
                                      dot=n56a/\frac{2n+1}{2}/n56b/ ];
\draw[semithick]
        (n57) -- ++ (0,-9mm) node[below,font=\footnotesize] {$2^{2}a-(2n+1)$};
%%%% legend at top right edge
\node[text width=0.44\linewidth,inner sep=2mm,align=left,
      below left = 3mm and 0mm of current bounding box.north east]
    {In each step of the expanding simple graphs,
     the vertices are labeled with a fraction and
     an \textit{a}-label. The fraction is a Farey
     Fraction; it is typeset above each vertex.
        };
    \end{tikzpicture}
\end{document}

enter image description here

|improve this answer|||||
  • That looks nice. I don't want it at the corner, though. Maybe 0.5cm from the corner. – user74973 Feb 23 at 19:39
  • Why does the tail of the last bent arrow look closer to the penultimate graph than the tails of the other bent arrows are from the graphs preceding them? – user74973 Feb 23 at 19:41
  • 1
    @user74973, you can shift node diagonally from corner with below left=5mm. Regarding image structure, I must confess, that image code is quite cryptic to me. About arrow bends you should ask author of code. I would not bent them. – Zarko Feb 23 at 19:47

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.