\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}