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

Post by jadhavboys »

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

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: how to plot a curve

Post by Stefan Kottwitz »

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

Stefan
LaTeX.org admin
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Re: how to plot a curve

Post by jadhavboys »

i have used Tikz. but i am not getting exat what i want
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

how to plot a curve

Post by Stefan Kottwitz »

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
LaTeX.org admin
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

how to plot a curve

Post by jadhavboys »

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}
But i am not getting what i want! can you help me in drawing what i want?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to plot a curve

Post by Johannes_B »

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: 10324
Joined: Mon Mar 10, 2008 9:44 pm

how to plot a curve

Post by Stefan Kottwitz »

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.

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} 
transformation.png
transformation.png (12.04 KiB) Viewed 6463 times
Stefan
LaTeX.org admin
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

how to plot a curve

Post by jadhavboys »

i am getting a error for \usetikzlibrary{positioning,decorations.markings,quotes}
can't find
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: how to plot a curve

Post by Stefan Kottwitz »

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
LaTeX.org admin
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Re: how to plot a curve

Post by jadhavboys »

How to do this?
Post Reply