中的pstricks
命令相当于什么?\psecurve
tikz
黄线是\psecurve
。它与 基本相同\pscurve
:曲线由所有命名点定义,但不会绘制到端点。
\documentclass{article}
\usepackage{pstricks}
\pagestyle{empty}
\begin{document}
\begin{pspicture}(0,-3)(5,5)
\pscurve[linewidth=5pt,arrows=<->](0,0)(2,3)(4,-3)(2,5)(1,0)
\psecurve[linewidth=1.5pt,linecolor=yellow](0,0)(2,3)(4,-3)(2,5)(1,0)
\end{pspicture}
\end{document}
答案1
你可以使用我的style between
风格(来自TikZ:曲线中的粗曲线段):
\documentclass[margin=2mm]{standalone}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{decorations.pathreplacing,decorations.markings}
\newcounter{pos}
\tikzset{
initcounter/.code={\setcounter{pos}{0}},
style between/.style n args={3}{
postaction={initcounter, decorate,
decoration={show path construction, curveto code={
\addtocounter{pos}{1}
\pgfmathtruncatemacro{\min}{#1 - 1}
\ifthenelse{\thepos < #2 \AND \thepos > \min}{
\draw[#3]
(\tikzinputsegmentfirst) .. controls
(\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
.. (\tikzinputsegmentlast);
}{}
}
}
},
},
}
\begin{document}
\begin{tikzpicture}[line join=round]
\draw[line width=5pt,<->]
(0,0) to[out=70,in=180] (2,3) to[out=0,in=180] (4,-3)
to [out=0,in=0] (2,5) to[out=180,in=100] (1,0);
\path [style between={2}{4}{line width=1.5pt,yellow}]
(0,0) to[out=70,in=180] (2,3) to[out=0,in=180] (4,-3)
to [out=0,in=0] (2,5) to[out=180,in=100] (1,0);
\end{tikzpicture}
\end{document}