绘图未正确缩放

绘图未正确缩放

我很难将一个简单的 置于中心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}

这给了我以下结果(我只裁剪了页面的底部):

剧情有缺陷 :(

如何将图居中?左边距似乎有空间可以这样做,为什么没有呢?

答案1

事实证明,我所要做的就是放置此部分:

\vspace{\baselineskip}
\fonte{Próprio autor.}
\label{fig:tanh-plot}

\end{tikzpicture}

我想我也需要睡一会儿。

现在的结果: 固定的,漂亮的情节

相关内容