Graphics, Figures & Tableshow to plot a curve

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

Well, use your package manager... it depends if it's MiKTeX or TeX Live or MacTeX or a Linux distro TeX.

But with a small change, removing the quotes library and changing the "..." syntax to label={...}, this should now run with older TikZ too:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.markings}
\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,label={$\gamma(a)$}] {};
  \node (gamma-b) [above right = 1cm   and 4 cm of gamma-a,
                   dot,label={$\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}
Stefan
LaTeX.org admin

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

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

Re: how to plot a curve

Post by jadhavboys »

can any one suggests me how to do this using older version of TIKZ
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 »

I did already. Did you read it and test it with the older TikZ?

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 downloaded the latest version of tikz but how to install it in linux?
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 »

Which Linux version (exactly) is it? And did you install TeX via this Linux, or via tug.org?

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

Re: how to plot a curve

Post by jadhavboys »

well if its works fine with old version, then can you please tell me how to do it?
jadhavboys
Posts: 26
Joined: Tue Feb 28, 2012 2:31 pm

Re: how to plot a curve

Post by jadhavboys »

i am using Ubunto 13.10 and i cannot update system also! thats the problem now
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:well if its works fine with old version, then can you please tell me how to do it?
I did, above, I posted code which works with the old version. Did you test it?

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

Re: how to plot a curve

Post by jadhavboys »

sorry but i am not understanding what to replace with what!
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 »

I posted a complete code example. The explanation what has been changed was in addition. Take the complete code example. Nothing to replace with something.

Stefan
LaTeX.org admin
Post Reply