4

I think I can deal with LaTeX but I really have problems to draw with it. I have some problems to handle TikZ. As an exercise I would like to draw the following picture:

example to draw

Maybe anybody can tell me how I can draw this (not necessarily with the frame around it) with LaTeX? In best case a little bit bigger than this. Would be very helpful because I do not know how to do it.

1

5 Answers 5

13

I would go the following way:

  1. Define the coordinates for the three dots (for example (0,0), (1.5,1), and (4,2)).
  2. For each coordinate, draw a small filled circle, and put a node below it, with the math formula.
  3. Put the final formula above the last coordinate.
  4. Draw the curve. This is the most difficult part, because connecting coordinates with curved paths require to specify either control points (if drawn as bezier curves), or the incoming and outcoming angle of the curve at each intermediate coordinate. I would go for the second solution.

So, the code could be

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (1.5,1);
\coordinate (C) at (4,2);

\foreach \coor/\formula in {A/{x=\phi(0;x)},B/{y=\phi(t;x)},C/{\phi(s;x)}} {
  \fill (\coor) circle (2pt);
  \node[below right, inner xsep=-1ex] at (\coor) {$\formula$};
}
\node[above] at (C) {$\phi(t+s;x)$};
\draw (A) to[in=190] (B) to[out=10, in=220] (C);
\end{tikzpicture}
\end{document}

Note that the angles at (B) should be carefully choosen so that the curve is smooth at that point. The curve enters (B) at 190 degrees, and leaves it at 10 degrees, so that both directions are colinear.

Result

9

A slightly different way of doing things, by specifying the path as a Bézier curve and positioning the points at the required 'times' along the curve. Also the quotes library is used (and the node contents key), so it requires the latest PGF release.

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{quotes}
\begin{document}
\begin{tikzpicture}[mark at/.style={shape=circle, fill, inner sep=1pt, node contents=, pos=#1}]
\draw (0,0) .. controls ++(60:2) and ++(220:2) .. (4,2)
  node [mark at=0,   "$x=\varphi(0;x)$" below]
  node [mark at=1,   "$\varphi(s;y)$"   below right,
                     "$\varphi(t+s;x)$" above]
  node [mark at=0.3, "$y=\varphi(t;x)$" below right];
\end{tikzpicture}
\end{document}

enter image description here

7

Using plain TeX. I tried to keep it as short as possible.

\input tikz
\tikz[dot/.style={draw,fill,circle,inner sep=1pt}]{
    \draw 
    (0,0) node[dot,label={below:$x=\phi(0;x)$}] {} .. controls ++(0.7,0.8) ..
    (1.5,1) node[dot,label={below:$y=\phi(t;x)$}] {} .. controls ++(1,0.2) ..
    (4,2) node[dot,label={below:$\phi(s;x)$},label={above:$\phi(t+s;x)$}] {};
  }
\bye

enter image description here

4

As for Mark Wibrow, but with MetaPost, here is a solution specifying the path as a Bezier curve. It allows us to make use of the MetaPost facilities in this domain. The directions to be followed by the path at the three nodes are easy to specify and change at need, via angles in degrees. It is to be processed with LuaLaTeX since it uses the luamplib package as interface to MetaPost.

\documentclass{standalone}
\usepackage{luamplib}
  \mplibsetformat{metafun}
\begin{document}
\begin{mplibcode}
beginfig(1);
  u = 1.5cm;
  z0 = origin; z1 = u*(2, 1); z2 = u*(5, 2);
  path mycurve; mycurve = z0{dir 40} .. z1{dir 10} .. z2{dir 30}; draw mycurve;
  dotlabel.bot(btex $x = \varphi(0; x)$ etex, z0);
  labeloffset := 7bp;
  dotlabel.bot(btex $y = \varphi(t; x)$ etex, z1);
  dotlabel.bot(btex $\varphi(s; y)$ etex, z2);
  labeloffset := 3bp;
  dotlabel.top(btex $\varphi(t+s; x)$ etex, z2);
  setbounds currentpicture to boundingbox currentpicture enlarged 2bp;
endfig;
\end{mplibcode}
\end{document}

enter image description here

1

With PSTricks just for fun. I use a set of non-piecewise functions to be more elegant.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-eucl}

\def\x[#1]{#1}
\def\y[#1]{(#1-4)^3/30+2}

\begin{document}
\begin{pspicture}[algebraic,PointNameSep=12pt](8,4)
    \psparametricplot{1}{7}{\x[t]|\y[t]}
    \pstGeonode[
        PointName={x=\varphi(0;x),y=\varphi(t;x),\varphi(s;y)},
        PosAngle={-90,-90,-45},
    ]
        (*1 {\y[x]}){A}
        (*4 {\y[x]}){B}
        (*7 {\y[x]}){C}
    \uput{6pt}[90](C){$\varphi(t+s;x)$}
\end{pspicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .