## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ how to plot a curve

Information and discussion about graphics, figures & tables in LaTeX documents.
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 2500 times

Stefan Kottwitz
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm
What do you use for drawing? TikZ?
What did you try?

Stefan

Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm
i have used Tikz. but i am not getting exat what i want

Stefan Kottwitz
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm
jadhavboys wrote:i have used Tikz. but i am not getting exat what i want

So what did you get? Can you show us your code? So we can continue with that instead of beginning from zero.

Stefan

Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm
\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}

But i am not getting what i want! can you help me in drawing what i want?

Johannes_B
Site Moderator
Posts: 4030
Joined: Thu Nov 01, 2012 4:08 pm
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
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm
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.

\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}

transformation.png (12.04 KiB) Viewed 2452 times

Stefan

Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm
i am getting a error for \usetikzlibrary{positioning,decorations.markings,quotes}
can't find

Stefan Kottwitz
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm
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