Math & Science ⇒ draw a graph
draw a graph
I have to draw in vector format as in the attached figure. I kindly ask for suggestions.
Thanks
- Attachments
-
- Fig009.jpg (90.64 KiB) Viewed 6890 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
What is the math formula for that graph you want to draw?
Stefan
draw a graph
Thanks for the welcome and for the help.
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
Stefan
draw a graph
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
Code: Select all
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[
domain = 0:1440,
samples = 1000,
]
\addplot[thick, blue] {sin(1.1*x)^2};
\legend{$\sin(1.1x)^2$}
\end{polaraxis}
\end{tikzpicture}
\end{document}
Seems the figure is from Landau and Lifshitz, Mechanics, Vol. 1, figure 9 in 14. Motion in a central field. That may explain how to (re)produce it.
It's also seen as figure 6.1 (Open path of a particle) from the paper KAM Stability of The Kepler Problem with a General Relativistic Correction Term by Majed Sofiani.
Stefan
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
Code: Select all
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[
domain = 0:360,
samples = 100,
]
\foreach \w in {0,30,...,360} {
\addplot[thick, blue] {(1*(1-0.8^2)/(1+0.8*cos(x+\w))};}
\end{polaraxis}
\end{tikzpicture}
\end{document}
With an arrow decoration macro from the pgfplots author Christian Feuersänger:
Code: Select all
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\usepgfplotslibrary{colormaps}
\usetikzlibrary{decorations.markings}
\tikzset{
set arrow inside/.code={\pgfqkeys{/tikz/arrow inside}{#1}},
set arrow inside={end/.initial=>, opt/.initial=},
/pgf/decoration/Mark/.style={
mark/.expanded=at position #1 with
{
\noexpand\arrow[\pgfkeysvalueof{/tikz/arrow inside/opt}]{\pgfkeysvalueof{/tikz/arrow inside/end}}
}
},
arrow inside/.style 2 args={
set arrow inside={#1},
postaction={
decorate,decoration={
markings,Mark/.list={#2}
}
}
},
}
\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[
domain = 0:360,
samples = 100,
]
\foreach \w in {0,30,...,360} {
\addplot[thick, blue] {(1*(1-0.8^2)/(1+0.8*cos(x+\w))} [arrow inside={end=stealth,opt={black, scale=1.05}}{0.5}];}
\end{polaraxis}
\end{tikzpicture}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
hide axis
:Code: Select all
\begin{polaraxis}[
domain = 0:360,
samples = 100,
hide axis,
]
...