Graphics, Figures & TablesTikz General Curve

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Tikz General Curve

Post by coachbennett1981 »

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.
Attachments
Screen Shot 2022-02-08 at 10.52.15 AM.png
Screen Shot 2022-02-08 at 10.52.15 AM.png (35.25 KiB) Viewed 3623 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Tikz General Curve

Post by Stefan Kottwitz »

You could use the hobby library with a few points as samples:

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}
With basic TikZ, smooth instead of hobby could be ok, perhaps not so nice and round.

Stefan
LaTeX.org admin
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Tikz General Curve

Post by coachbennett1981 »

Thank you for the quick response!
Post Reply