# Make graphic looks like functions with TikZ

How could I achieve that? (TikZ preferably) I tried with \draw[blue] plot[smooth] coordinates {(0,0) (3.5,4) (5.5,7)}; but It's not super efficient and doesn't exactly produce the result.

Any help?

Thanks

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. As a gift of bienvenue, you can find below an answer to your need. Mar 2, 2022 at 11:32
• Hm, "super-linear"? So far I know only linear function 😎 Mar 2, 2022 at 12:54
• Do you have any set of data that you want to use?
– hola
Mar 2, 2022 at 22:02
• @hola No, the lecture class slide didn't provide any data, It was just arbitrary to show how speed could evolve. Mar 3, 2022 at 19:36
• @Zarko Hehe, but It exists :P Mar 3, 2022 at 19:36

Use Bézier curves. \documentclass[tikz,border=3.14mm]{standalone}

\begin{document}
\begin{tikzpicture}[
font=\sffamily\scriptsize,
lbl/.style={
rectangle,
draw,
text width=1.8cm,
align=center,
inner sep=2pt
}
]

\draw[<->] (0,6) |- (6,0) node[pos=0.1,left] {S\textsubscript{p}} node[pos=0.75,below] {\# of processors};
\draw (0,0) -- (5,5) coordinate[pos=0.9] (A);
\draw[red,thick] (0,0) .. controls ++(3,3) and ++(-1,-0.1) .. (5.5,3) coordinate[pos=0.6] (B);
\draw[olive,thick] (0,0) .. controls ++(3,3) and ++(-.2,-1) .. (3.5,5.5) coordinate[pos=0.7] (C);

\draw[<-] (A) --++ (0.75,-0.5) node[lbl,below] {linear speedup};
\draw[<-] (B) --++ (0.5,-1) node[lbl,below] {sub-linear speedup (common)};
\draw[<-] (C) --++ (-1.5,0.5) node[lbl,above] {super-linear speedup (wonderful)};
\end{tikzpicture}
\end{document}