3

I have created the following graph using TikZ.

As you can see, the area of the tikzpicture is unnecessarily large. I believe that this is due to the inclusion of the invisible control points in the tikzpicture. Is there any way I can get TikZ to ignore them?

Here is my code:

\documentclass{article}

\usepackage{amsmath, tikz}

\begin{document}
    $\boxed{
    \begin{tikzpicture}
        % Nodes
        \foreach \i in {1,...,3}{
            \node[circle, draw=black, thick, fill=gray!10] (\i) at (2.5*\i - 2.5, 2.5) {\i};
        }  

        \foreach \i in {4,...,6}{
            \node[circle, draw=black, thick, fill=gray!10] (\i) at (2.5*\i - 10,0) {\i};
           }   

        % Drawing
        \draw[thick] (1) -- (4);
        \draw[thick] (1) -- (5);
        \draw[thick] (1) -- (6);
        \draw[thick] (2) -- (6);
        \draw[thick] (3) -- (6);
        \draw[thick] (2) .. controls (-1, 5) and (-3, 1)  .. (4);
        \draw[thick] (2) .. controls (-3, 7) and (-5, -4) .. (5);
        \draw[thick] (3) .. controls (7, 1)  and (6, -3)  .. (5);
        \draw[thick, gray!50, dashed] (3) .. controls (10, 1)  and (6, -5)  .. (4);
        \draw[thick, gray!50, dashed] (3) .. controls (-4, 10)  and (-5, -5)  .. (4);
    \end{tikzpicture}}$
\end{document}

Also, on a side note, is there a way I can modify the out angle of the edges? I usually use the to command, e.g.

\draw (node1) to[out = 0] (node 2);

But I don't know how to do this for Bézier curves.

Luke Collins
  • 1,910
  • 5
    You can use \clip (a,b) rectangle (c,d); to clip. – Sigur Jun 15 '18 at 14:19
  • 1
    Please have a look here. I think your question is a duplicate, but I do not want to use my dupehammer. –  Jun 15 '18 at 15:11
  • I do not think that you can add the out (nor in) to Bezier plots since this would overconstrain the system. (Bezier curves are solutions to quadratic or cubic equations, depending on the number of control points). However, you can play with the looseness parameter to adjust the shape of a path with fixed in and/or out. I personally find this more intuitive. –  Jun 15 '18 at 21:52
  • @marmot How would you do that? – Luke Collins Jun 15 '18 at 22:05
  • \draw (node1) to[out = 0,looseness=1.5] (node 2); –  Jun 15 '18 at 22:06
  • 1
    @marmot I was not :) So I'll delete my comments. – Kpym Jun 16 '18 at 11:20
  • Load the bbox library and use the bezier bounding box key on the last five paths. – Qrrbrbirlbel Jun 24 '23 at 17:22

0 Answers0