Math & Sciencedraw a graph

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
magi6162
Posts: 6
Joined: Thu Jan 14, 2021 8:33 pm

draw a graph

Post by magi6162 »

This is the end result, it definitely isn't "clean", so who has suggestions to make it better ....
thanks to those who helped me.

Code: Select all

\begin{tikzpicture}[>=latex,scale=1]
	\begin{polaraxis}[
 	domain  = 0:360,
	samples = 100,
	hide axis,
	]
 		\foreach \w in {140,160,...,340} {
			\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+\w))} [arrow inside={end=stealth,opt={black, scale=1.05}}{0.5}];}
		\addplot[ultra thick, white, domain={97.5:200}] {(1*(1-0.8^2)/(1.2+0.8*cos(x+140)};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+360))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+340))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+320))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+300))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+280))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+260))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+240))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+220))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+200))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+180))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+160))};
				
		\addplot[ultra thick, white, domain={10:300}] {(1*(1-0.8^2)/(1.2+0.8*cos(x+360))};
		\addplot[thick, black, domain={295:360}] {(1*(1-0.8^2)/(1.2+0.8*cos(x+360))} [arrow inside={end=stealth,opt={black, scale=1.05}}{0.2}];
						
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+340))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+320))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+300))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+280))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+260))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+240))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+220))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+200))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+180))};
		\addplot[thick, black] {(1*(1-0.8^2)/(1.2+0.8*cos(x+160))};
		\addplot[thick, black, domain={285:300}] {(1*(1-0.8^2)/(1.2+0.8*cos(x+140))};
		\addplot [->] [thin] coordinates {(0,0) (120,0.9)};
		\addplot [->] [thin] coordinates {(0,0) (0,0.18)};
		\addplot [thin] coordinates {(220,0.92) (220,0.89)};
		\addplot [thin] coordinates {(200,0.92) (200,0.89)};
		\addplot [thin, black,dashed] {0.9};
		\addplot [thin, black,dashed] {0.18};
		\addplot [thin, black, fill=white] {0.02};
	\end{polaraxis}
	\draw[decorate,decoration=brace,rotate around={-230:(1.66,2.3)}] (1.5,3) -- (2.8,2.8);
	\coordinate [label={[font=\small] center:$\mathit{\Delta}\varphi$}] (D) at (0.45,2.2);
	\coordinate [label={[font=\small] center:$r_{\text{max}}$}] (rmax) at (2.45,6.5);
	\coordinate [label={[font=\small] center:$r_{\text{min}}$}] (rmin) at (4.5,3.9);
\end{tikzpicture}

Recommended reading 2024:

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

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

Post Reply