我很难将一个简单的 置于中心pgfplots
。
这是我的代码:
\begin{figure}[h!]
\centering
\caption{ Comparação da função tangente hiperbólica em diferentes implementações.}
\vspace{\baselineskip}
\fonte{Próprio autor.}
\label{fig:tanh-plot}
\begin{tikzpicture}[spy using outlines={circle, magnification=3, connect spies}]
\begin{axis}[
xlabel={$ x $},
ylabel={$ y = \tanh{x} $},
xmin=-3.5, xmax=3.5,
ymin=-1.0, ymax=1.0,
legend pos=north west,
ymajorgrids=true,
grid style=dashed,
]
\addplot[color=orange, mark=*,]
table {plots/tanh-tf.dat};
\addlegendentry{Keras/TensorFlow (Python)}
\addplot[color=blue, mark=*,]
table {plots/tanh-vhdl.dat};
\addlegendentry{Interpolação (VHDL)}
\coordinate (spypoint) at (axis cs:-.75, -.63);
%\coordinate (spypoint) at (axis cs:0, 0);
\coordinate (magnifyglass) at (axis cs:2, -.2);
\end{axis}
\spy[blue, size=8cm] on (spypoint) in node[fill=white] at (magnifyglass);
\end{tikzpicture}
\end{figure}
这给了我以下结果(我只裁剪了页面的底部):
如何将图居中?左边距似乎有空间可以这样做,为什么没有呢?