So I am trying to have a TikZ picture that's centered in the middle of the page and treated as a normal figure. I want text following the image as a paragraph. However, when I use the figure environment, it allocates an entire page to the image and I can't get the text I want on the same page. When I try using the wrap figure environment I get what you see below.
[![What I have now][1]][1]
\begin{wrapfigure}{c}{\textwidth}
\centering
\begin{tikzpicture}[scale=4]
\draw[ultra thick] (0,0) circle (1);
\draw[thick, black!70] (0,0) -- (1,0);
\node[scale=1.5] at (0.5,-0.10) {$r = 1$};
\node[scale=1.2] at (0.58,0.58) {$\frac{S_1}{2}$};
\draw[fill] (0,0) circle(0.04) node[anchor=north east, scale=2] (center) at (-0.05,0.04) {$A$};
%First polygon n=6 !=60
\node[regular polygon, regular polygon sides=6, minimum size=1cm, thick, black!60, scale=8, draw] at (0,0) {};
\foreach \i in {60,120,...,300}{
\draw[thick, black!70] (0,0) -- ({cos(\i)}, {sin(\i)} );
}
\node[scale=1.5] at ({cos(60) + 0.05}, {sin(60) + 0.1} ) {$E$};
\node[scale=1.5] at ({cos(0) + 0.1},0) {$G$};
\draw[thick, black!70] (0,0) -- ({cos(30)}, {sin(30} ) node[anchor=north west, scale=1] at ({cos(30)/2 + 0.05}, {sin(30)/2 + 0.05} ) {$a$} node[anchor=north, scale=1] at ({cos(30) - 0.02}, {sin(30)} ) {$b$} node[anchor=north, scale=1.2] at ({cos(30) + 0.1}, {sin(30) + 0.2} ) {$T$} node[anchor=north, scale=1.2] at ({cos(30) - 0.15}, {sin(30) - 0.1} ) {$F$};
\draw[thick, black!70] (0.25,0) arc (0:60:0.25);
\draw[thin, black!70] ({cos(45)/4 - cos(45)/40.125}, {sin(45)/4 - sin(45)/40.125} ) -- ({cos(45)/4 + cos(45)/40.125}, {sin(45)/4 + sin(45)/40.125} );
\draw[thin, black!70] ({cos(15)/4 - cos(15)/40.125}, {sin(15)/4 - sin(15)/40.125} ) -- ({cos(15)/4 + cos(15)/40.125}, {sin(15)/4 + sin(15)/40.125} );
%n=12 !=80
\foreach \i in {0,30,...,330}{
\draw[thick, black!80] ({cos(\i)}, {sin(\i)}) -- ({cos(\i + 30)}, {sin(\i + 30)});
}
\foreach \i in {30,60,...,180,240,270,...,330}{
\draw[thick, black!80] (0,0) -- ({cos(\i)}, {sin(\i)} );
}
\end{tikzpicture}
\caption{Circle $A$ with inscribed polygons 1 and 2}
\label{fig:circ4}
\end{wrapfigure}
I want the TikZ picture to be treated like a normal figure, with a paragraph following it and is centered in the middle. Should be simple right? I'm new to LaTeX and have looked all over this site for threads and found nothing that helps me with what I want. Maybe I missed a thread because I would think this would be relatively simple.
Below is pretty much what I want, but instead a TikZ drawing, not a graphic. Also, excuse the awful quality I just looked it up on google really quick to give you guys an idea.
[![Low quality example][2]][2]
Edit: So I see a lot of use the figure environment instead of wrapfigure, I tried this. What happens is whenever I use the figure environment, it sections off an entire page for the figure, so there's just half a page blank on the previous page, then no text following the image.
[![Here is what it looks like, the text appears above the image not below.][3]][3]
Edit 2: It's fixed! using \begin{figure}[H] instead of \begin{figure}[h] worked! Thanks for the help!
wrapfigure. See https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – hpekristiansen Oct 28 '20 at 18:20