LaTeX forum ⇒ Graphics, Figures & Tableshow to plot a curve

Information and discussion about graphics, figures & tables in LaTeX documents.
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

how to plot a curve

Postby jadhavboys » Fri Mar 11, 2016 5:32 pm

how to draw following curve in latex!
Attachments
Untitled.png
curve
Untitled.png (131.58 KiB) Viewed 2500 times

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

Postby Stefan Kottwitz » Sat Mar 12, 2016 6:18 pm

What do you use for drawing? TikZ?
What did you try?

Stefan
Site admin

jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Postby jadhavboys » Sun Mar 13, 2016 1:49 pm

i have used Tikz. but i am not getting exat what i want

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

Postby Stefan Kottwitz » Sun Mar 13, 2016 1:55 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
Site admin

jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Postby jadhavboys » Sun Mar 13, 2016 2:16 pm

  1. \begin{tikzpicture}[x=4cm,y=4cm]
  2.  
  3. \draw[line width=1pt] (0,0) .. controls (0.17,0.67) and (0.83,0.67) .. (1,1);
  4.  
  5.  
  6. \node[label={[label distance=0.0cm,text depth=-1ex]left:$\gamma$}] at (-0.1,.8) {};
  7.  
  8. \end{tikzpicture}


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

User avatar
Johannes_B
Site Moderator
Posts: 4030
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Mar 13, 2016 3:02 pm

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

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

Postby Stefan Kottwitz » Sun Mar 13, 2016 3:16 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.

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usetikzlibrary{positioning,decorations.markings,quotes}
  4. \begin{document}
  5. \begin{tikzpicture}[
  6. dot/.style = {circle, draw, fill, inner sep=2pt},
  7. decoration = {
  8. markings,
  9. mark=at position 0.5 with {\pgftransformscale{2}\arrow{stealth}}},
  10. ]
  11. \node (gamma-a) [dot,"$\gamma(a)$"] {};
  12. \node (gamma-b) [above right = 1cm and 4 cm of gamma-a,
  13. dot,"$\gamma(b)$"] {};
  14. \node (below) [below right = 0.5cm and 1 cm of gamma-a] {};
  15. \node (above) [above left = 0.5cm and 1 cm of gamma-b] {};
  16. \draw [postaction={decorate}] (gamma-a)
  17. to [out=0, in=180] (below)
  18. to [out=0, in=180] (above)
  19. to [out=0, in=180] (gamma-b);
  20. \node (gamma-t) [below left = 0.1cm and 2.2 cm of gamma-b]
  21. {$\gamma(t)$};
  22. \end{tikzpicture}
  23. \end{document}


transformation.png
transformation.png (12.04 KiB) Viewed 2452 times


Stefan
Site admin

jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Postby jadhavboys » Sun Mar 13, 2016 3:39 pm

i am getting a error for \usetikzlibrary{positioning,decorations.markings,quotes}
can't find

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

Postby Stefan Kottwitz » Sun Mar 13, 2016 3:51 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
Site admin

jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Postby jadhavboys » Mon Mar 14, 2016 5:35 am

How to do this?


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 2 guests