I have tried messing with my \myPlotB \draw location, but it does not work, I have tried minipage, but I keep getting errors.
Code: Select all
\documentclass[12pt]{article}
\usepackage[margin=.5in]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{patterns,angles,quotes,shadings,arrows.meta}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepackage{multicol}
\pgfplotsset{every x tick label/.append style={font=\footnotesize, yshift=0.6ex}}
\pgfplotsset{every y tick label/.append style={font=\footnotesize, xshift=0.5ex}}
\newcommand{\myplotB}[1]{
\begin{tikzpicture}
\draw[-Triangle] (-2,0)--(2,0);
\draw[Triangle-] (0,2)--(0,-2);
\node[below] at (2,0){$x$};
\node[above] at (0,2){$y$};
\node[below right] at (1,0){\footnotesize{1}};
\draw (0,0) circle [radius=1cm];
\end{tikzpicture}\hspace{.5in}
}
\begin{document}
\section*{Graphing Cosine Functions}
\noindent\rule{15cm}{0.4pt}
The function $y=A\cos t +k$ have \textbf{amplitude} $|A|$ and their \textbf{midline} is the horizontal line $y=k$
\begin{tikzpicture}
\begin{axis}[
grid style={blue!50},
axis x line = center,
axis y line = center,
xlabel style={above right},
ylabel style={above right},
xlabel={$x$}, ylabel={$y$},
xtick = {-1.5707, 0, ..., 6.28318},
xmin = -2, xmax =6.28318,
ymin = -3, ymax = 3,
ytick = {-3,-2,...,3},
xticklabels = {$-\frac{\pi}{2}$, 0,
$\frac{\pi}{2}$, $\pi$, $\frac{3\pi}{2}$, $2\pi$},
grid = both,
]
\addplot[samples=300,domain=0:6.28318,color=red] {cos(deg(x))};
\filldraw[red] (0,1) circle (3pt) node at (0,1){};
\end{axis}
\end{tikzpicture}
\qquad
\myplotB
\end{document}