Graphics, Figures & Tables ⇒ how to plot a curve
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
how to plot a curve
- Attachments
-
- curve
- Untitled.png (131.58 KiB) Viewed 6510 times
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
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
Re: how to plot a curve
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- 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
-
- 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
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
how to plot a curve
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}
-
- Posts: 26
- Joined: Tue Feb 28, 2012 2:31 pm
how to plot a curve
\usetikzlibrary{positioning,decorations.markings,quotes}
can't find
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: how to plot a curve
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