Hey Everyone,
I am trying to figure out how to draw a generic curve using tikz. Like the picture attached. I don't know where to begin. I can handle the axis using the \draw command and the nodes, but a general curve is where I get stuck. I know how to plot function in Tikz and PGF, but not something as random.
Any help would be appreciated.
Graphics, Figures & Tables ⇒ Tikz General Curve
-
- Posts: 274
- Joined: Fri Feb 05, 2010 10:15 pm
Tikz General Curve
- Attachments
-
- Screen Shot 2022-02-08 at 10.52.15 AM.png (35.25 KiB) Viewed 3623 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Tikz General Curve
You could use the
hobby library with a few points as samples:
With basic TikZ,
Stefan

Code: Select all
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{hobby}
\begin{document}
\begin{tikzpicture}
\draw plot [hobby] coordinates {(0,4) (1,3.2) (2,1.5) (2.5,1.2) (3,1) (4,0.8)};
\end{tikzpicture}
\end{document}
smooth
instead of hobby
could be ok, perhaps not so nice and round.Stefan
LaTeX.org admin
-
- Posts: 274
- Joined: Fri Feb 05, 2010 10:15 pm
Tikz General Curve
Thank you for the quick response!