Tikzpicture 和 Includegraphics 的使用

Tikzpicture 和 Includegraphics 的使用

以下代码仅输出线条,但图形消失了。有人能建议如何强制输出绘制的线条和图形吗?非常感谢!

\begin{figure}[ht!]
\begin{picture}(300,570)(0,80)
\begin{tikzpicture}
\put(0,440){\includegraphics[width=5.8in]{s1cbymax}}
\put(0,330){\includegraphics[width=5.8in]{s1f0bymax}}
\put(0,220){\includegraphics[width=5.8in]{s1f1bymax}}
\put(0,110){\includegraphics[width=5.8in]{s1f2bymax}}
\put(0,0){\includegraphics[width=5.8in]{s1f3bymax}}
\put(-10,360){\begin{sideways}\small$y^*$\end{sideways}}
\put(210,75){\small$\bar{u}/u_c$}

\put(210,75){\draw (30,0)--(30,5);}

\end{tikzpicture}
\end{picture}
\caption[$Set\:1$: Velocity profile normalized by maximum velocity]{$Set\:1$: Velocity profile normalized by maximum velocity.}
\label{s1profilebymax}
\end{figure}

答案1

tikzpicture如果在命令中使用环境\put而不是直接嵌套在picture环境中,图形就会重新出现:

\begin{picture}(300,570)(0,80)
\put(0,440){\includegraphics[width=5.8in]{s1cbymax}}
\put(0,330){\includegraphics[width=5.8in]{s1f0bymax}}
\put(0,220){\includegraphics[width=5.8in]{s1f1bymax}}
\put(0,110){\includegraphics[width=5.8in]{s1f2bymax}}
\put(0,0){\includegraphics[width=5.8in]{s1f3bymax}}
\put(-10,360){\begin{sideways}\small$y^*$\end{sideways}}
\put(210,75){\small$\bar{u}/u_c$}
\put(210,75){\begin{tikzpicture}\draw (30,0)--(30,5);\end{tikzpicture}}
\end{picture}

或更简单

\put(210,75){\tikz\draw (30,0)--(30,5);}

但是,我不会将 TikZ 和图片环境混合使用。我只会使用 TikZ。

相关内容