Graphics, Figures & Tables ⇒ how to plot a curve
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
how to plot a curve
how to draw following curve in latex!
- Attachments
-
- curve
- Untitled.png (131.58 KiB) Viewed 6625 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
Re: how to plot a curve
i have used Tikz. but i am not getting exat what i want
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
how to plot a curve
So what did you get? Can you show us your code? So we can continue with that instead of beginning from zero.jadhavboys wrote:i have used Tikz. but i am not getting exat what i want
Stefan
LaTeX.org admin
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
how to plot a curve
Code: Select all
\begin{tikzpicture}[x=4cm,y=4cm]
\draw[line width=1pt] (0,0) .. controls (0.17,0.67) and (0.83,0.67) .. (1,1);
\node[label={[label distance=0.0cm,text depth=-1ex]left:$\gamma$}] at (-0.1,.8) {};
\end{tikzpicture}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
how to plot a curve
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
how to plot a curve
Here's a quick drawing of the function image, using nodes and the to operation.
I used relative positions, by changing the values you can tweak the drawing.
Stefan
I used relative positions, by changing the values you can tweak the drawing.
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.markings,quotes}
\begin{document}
\begin{tikzpicture}[
dot/.style = {circle, draw, fill, inner sep=2pt},
decoration = {
markings,
mark=at position 0.5 with {\pgftransformscale{2}\arrow{stealth}}},
]
\node (gamma-a) [dot,"$\gamma(a)$"] {};
\node (gamma-b) [above right = 1cm and 4 cm of gamma-a,
dot,"$\gamma(b)$"] {};
\node (below) [below right = 0.5cm and 1 cm of gamma-a] {};
\node (above) [above left = 0.5cm and 1 cm of gamma-b] {};
\draw [postaction={decorate}] (gamma-a)
to [out=0, in=180] (below)
to [out=0, in=180] (above)
to [out=0, in=180] (gamma-b);
\node (gamma-t) [below left = 0.1cm and 2.2 cm of gamma-b]
{$\gamma(t)$};
\end{tikzpicture}
\end{document}
LaTeX.org admin
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
how to plot a curve
i am getting a error for
can't find
\usetikzlibrary{positioning,decorations.markings,quotes}
can't find
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Re: how to plot a curve
What is the exact error message?
Do you know which version of TikZ you are using? It should be at least TikZ 3. If it's older, I recommend to update, since TikZ has been improved a lot.
Stefan
Do you know which version of TikZ you are using? It should be at least TikZ 3. If it's older, I recommend to update, since TikZ has been improved a lot.
Stefan
LaTeX.org admin