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 6472 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
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: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
draw a graph
Stefan
draw a graph
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- 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: 10324
- 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: 10324
- 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,]...