我想绘制如下图所示的曲线网格。
请帮我用腹部控制网格并淡化颜色。
平均能量损失
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach[count=\j] \i in {3,3.5,...,10.5}{
\pgfmathsetmacro{\xb}{0.4-0.05*\j}
\pgfmathsetmacro{\yb}{11-0.01*\j}
\pgfmathsetmacro{\xc}{7-0.3*\j}
\pgfmathsetmacro{\opa}{100-0.5*\j}
\draw[thick,cyan!\opa] (\i,27) .. controls +(270:6) and +(80:4.5)..
(\xb,\yb)..controls +(260:4.5) and +(75:4.6)..(\xc,0);
}
\end{tikzpicture}
\end{document}
2021 年 5 月 11 日更新,彩虹色代码
\documentclass[tikz]{standalone}
\begin{document}
\def\n{30}
\begin{tikzpicture}
\foreach[count=\j] \i in {3,3.5,...,10.5}{
\pgfmathsetmacro{\xb}{0.4-0.05*\j}
\pgfmathsetmacro{\yb}{11-0.01*\j}
\pgfmathsetmacro{\xc}{7-0.3*\j}
\pgfmathsetmacro{\opa}{100-0.5*\j}
\pgfmathsetmacro{\faktor}{(\j-1)*400/\n+350}
\definecolor{rainbow}{wave}{\faktor}
\draw[ultra thick,rainbow] (\i,27) .. controls +(270:6) and +(80:4.5)..
(\xb,\yb)..controls +(260:4.5) and +(75:4.6)..(\xc,0);
}
\end{tikzpicture}
\end{document}
答案1
您的代码修改如下:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach[count=\j] \i in {3,3.5,...,10.5}{
\pgfmathsetmacro{\xb}{0.4-0.05*\j}
\pgfmathsetmacro{\yb}{11-0.01*\j}
\pgfmathsetmacro{\xc}{7-0.3*\j}
\pgfmathsetmacro{\k}{int(\j*100/16)}
\draw[thick,cyan!\k] (\i,27) .. controls +(270:6) and +(80:4.5)..
(\xb,\yb)..controls +(260:4.5) and +(75:4.6)..(\xc,0);
}
\end{tikzpicture}
\end{document}
你会得到这样的结果: