TikZ:为什么装饰会导致尺寸太大?

TikZ:为什么装饰会导致尺寸太大?
\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}

\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\begin{document}
\tdplotsetmaincoords{60}{130}
\begin{tikzpicture}[tdplot_main_coords]
  \coordinate (O) at (0, 0, 0);

  \draw[-latex] (O) -- (4, 0, 0) node[pos = 1.1, font = \scriptsize] {\(x\)};
  \draw[-latex] (O) -- (0, 4, 0) node[pos = 1.1, font = \scriptsize] {\(y\)};
  \draw[-latex] (O) -- (0, 0, 4) node[pos = 1.1, font = \scriptsize] {\(z\)};

  \begin{scope}[decoration = {markings,
      mark = at position 0.15 with {\node[font = \scriptsize, above] {C};}
    }]
    \draw[blue, name path = sc] plot[smooth] coordinates
    {(-3, -3, 1) (-1, 1, 2.5) (2, 5, 1.5) (3, 5, 0)};
  \end{scope}
\end{tikzpicture}
\end{document}

当我postaction = decorate向蓝色路径添加内容时,出现“尺寸过大”错误。由于该pos =选项不适用于绘图,我该如何纠正此问题?

在此处输入图片描述

答案1

那么使用节点怎么样?

\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}

\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\begin{document}
\tdplotsetmaincoords{60}{130}
\begin{tikzpicture}[tdplot_main_coords]
  \coordinate (O) at (0, 0, 0);

  \draw[-latex] (O) -- (4, 0, 0) node[pos = 1.1, font = \scriptsize] {\(x\)};
  \draw[-latex] (O) -- (0, 4, 0) node[pos = 1.1, font = \scriptsize] {\(y\)};
  \draw[-latex] (O) -- (0, 0, 4) node[pos = 1.1, font = \scriptsize] {\(z\)};

  \begin{scope}[decoration = {markings,
      mark = at position 0.15 with {\node[font = \scriptsize, above] {C};}
    }]
    \draw[blue, name path = sc] plot[smooth] coordinates
    {(-3, -3, 1) (-1, 1, 2.5) (2, 5, 1.5) (3, 5, 0)};
\draw (-3, -3, 1) node[above=-1.5bp]{$c$};
  \end{scope}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容