将 pgfplots 与标题对齐并解决浮动问题

将 pgfplots 与标题对齐并解决浮动问题

我目前有四张 pgfplot,每张图都有标题。但是,我无法将其中两张图与标题并排。另外,itemize 应该放在图表后面,而不是前面。我想要的只是五张图表,然后在底部添加一些注释。

这是我目前得到的。

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{intersections}
\usetikzlibrary{patterns}

\geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 bottom=20mm
 }

\begin{document}

\vspace{-15mm}\begingroup
\centering
\LARGE Logarithmic Functions and Transformations of it\\[0.5em]
\endgroup

\begin{figure}[ht]
\begin{tikzpicture}[E/.style={font=\small,text=black, sloped, pos=0.75}]
    \begin{axis}[axis line style=thick,
    axis x line=center,
    axis y line=center,
    samples=500,
    ytick={-4,-2,...,4,6},
    xtick={0,2,...,10},
    ymin=-7, ymax=7, xmin=-1, xmax=11, xlabel=\(x\), ylabel=\(y\), grid=major]

    \addplot[name path=A,domain=4:8] { ln(x)} node[E,above] {\scriptsize$y=ln(x)$};
    \addplot[name path global=line1, color=blue!50, thick, domain=0.001:11]{ln(x)};
    \addplot[name path=A,domain=4:6] { 2*ln(x)} node[E,above] {\scriptsize$y=2\,ln(x)$};
    \addplot[name path global=line1, color=red!50, thick, domain=0.001:11]{2*ln(x)};
    \addplot[name path=A,domain=8:10] { 0.5*ln(x)} node[E,above] {\scriptsize$y=\frac{1}{2}ln(x)$};
    \addplot[name path global=line1, color=green!80!black, thick, domain=0.001:11]{0.5*ln(x)};
    \end{axis}
\end{tikzpicture}
\caption{Vertical Expansion/Contraction by adjusting $A$}
\begin{tikzpicture}[E/.style={font=\small,text=black, sloped, pos=0.75}]
    \begin{axis}[axis line style=thick,
    axis x line=center,
    axis y line=center,
    samples=500,
    ytick={-4,-2,...,4,6},
    xtick={0,2,...,10},
    ymin=-3, ymax=5, xmin=-1, xmax=11, xlabel=\(x\), ylabel=\(y\), grid=major]

    \addplot[name path=A,domain=4:8] { ln(x)} node[E,above] {\scriptsize$y=ln(x)$};
    \addplot[name path global=line1, color=blue!50, thick, domain=0.001:11]{ln(x)};
    \addplot[name path=A,domain=4:6] { ln(2*x)} node[E,above] {\scriptsize$y=ln(2x)$};
    \addplot[name path global=line1, color=red!50, thick, domain=0.001:11]{ln(2*x)};
    \addplot[name path=A,domain=8:10] { ln(0.5*x)} node[E,above] {\scriptsize$y=ln(\frac{1}{2}x)$};
    \addplot[name path global=line1, color=green!70!black, thick, domain=0.001:11]{ln(0.5*x)};
    \end{axis}
\end{tikzpicture}
\caption{Horizontal Expansion/Contraction by adjusting C}
\end{figure}
\begin{figure}[ht]
\begin{tikzpicture}[E/.style={font=\small,text=black, sloped, pos=0.75}]
    \begin{axis}[axis line style=thick,
    axis x line=center,
    axis y line=center,
    samples=500,
    ytick={-6,-4,...,4,6},
    xtick={-4,-2,...,4},
    ymin=-7, ymax=7, xmin=-5, xmax=7, xlabel=\(x\), ylabel=\(y\), grid=major]

    \addplot[name path=A,domain=2:4] { ln(x)} node[E,below] {\scriptsize$y=ln(x)$};
    \addplot[name path global=line1, color=blue!50, thick, domain=0.001:7]{ln(x)};
    \addplot[name path=A,domain=0.5:3] { ln(x+3)} node[E,above] {\scriptsize$y=ln(x+3)$};
    \addplot[name path global=line1, color=red!50, thick, domain=-2.999:7]{ln(x+3)};
    \addplot[name path=A,domain=3:6] { ln(x-3)} node[E,below=10pt] {\scriptsize$y=ln(x-3)$};
    \addplot[name path global=line1, color=green!70!black, thick, domain=3.001:7]{ln(x-3)};
    \end{axis}
\end{tikzpicture}
\caption{Horizontal Translation by adjusting C}
\begin{tikzpicture}[E/.style={font=\small,text=black, sloped, pos=0.75}]
    \begin{axis}[axis line style=thick,
    axis x line=center,
    axis y line=center,
    samples=500,
    ytick={-6,-4,...,4,6},
    xtick={-4,-2,...,4},
    ymin=-7, ymax=7, xmin=-5, xmax=7, xlabel=\(x\), ylabel=\(y\), grid=major]
    \addplot[name path=A,domain=2:4] { ln(x)} node[E,below] {\scriptsize$y=ln(x)$};
    \addplot[name path global=line1, color=blue!50, thick, domain=0.001:7]{ln(x)};
    \addplot[name path=A,domain=0.5:3] { ln(x)+3} node[E,above] {\scriptsize$y=ln(x)+3$};
    \addplot[name path global=line1, color=red!50, thick, domain=-2.999:7]{ln(x)+3};
    \addplot[name path=A,domain=3:6] { ln(x)-3} node[E,below=10pt] {\scriptsize$y=ln(x)-3$};
    \addplot[name path global=line1, color=green!70!black, thick, domain=3.001:7]{ln(x)-3};
    \end{axis}
\end{tikzpicture}
\caption{Vertical Translation by adjusting $D$}
\begin{tikzpicture}[E/.style={font=\small,text=black, sloped, pos=0.75}]
    \begin{axis}[axis line style=thick,
    axis x line=center,
    axis y line=center,
    samples=500,
    ytick={-6,-4,...,4,6},
    xtick={-4,-2,...,4},
    ymin=-7, ymax=7, xmin=-5, xmax=7, xlabel=\(x\), ylabel=\(y\), grid=major]
    \addplot[name path=A,domain=2:4] { ln(x)} node[E,below] {\scriptsize$y=ln(x)$};
    \addplot[name path global=line1, color=blue!50, thick, domain=0.001:7]{ln(x)};
    \addplot[name path=A,domain=0.5:3] { ln(x)+3} node[E,above] {\scriptsize$y=-ln(x)$};
    \addplot[name path global=line1, color=red!50, thick, domain=-2.999:7]{-ln(x)};
    \addplot[name path=A,domain=3:6] { ln(-x)} node[E,below=10pt] {\scriptsize$y=ln(-x)$};
    \addplot[name path global=line1, color=green!70!black, thick, domain=3.001:7]{ln(-x)};
    \end{axis}
\end{tikzpicture}
\end{figure}

\begin{itemize}
    \item $a$ is the base of the logarithm. The higher it is, the flatter the graph. Normally we do not consider transformations using the base.
    \item The larger the $A$, the bigger the expansion. Contrarily, the smaller it is, the larger the contraction.
    \item The larger the $B$, the flatter the graph becomes. Contrarily, the smaller it is, it pushes the graph towards the $y$-axis, making the graph higher for the same $x$ values.
    \item If $C$ is positive, this shifts the graph to the left. If it is negative, it shifts the graph to the right. Note that there will be a vertical asymptote of $x=-C$.
    \item If $D$ is positive, this shifts the graph up. If it is negative, it shifts the graph down. The verical asymptote remains as $x=-C$
\end{itemize}

\end{document}

图片1图片2

相关内容