What is the equivalent of the pstricks command \psecurve in tikz?

The yellow line is the \psecurve. It's basically the same as the \pscurve: the curve is defined by all the named points, but is not drawn to the end points.




enter image description here


1 Answer 1


You can use my style between style (from TikZ: Thick curve segment in a curve):

enter image description here

  style between/.style n args={3}{
    postaction={initcounter, decorate,
      decoration={show path construction, curveto code={
          \pgfmathtruncatemacro{\min}{#1 - 1}
          \ifthenelse{\thepos < #2 \AND \thepos > \min}{
            (\tikzinputsegmentfirst) .. controls
               (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
            .. (\tikzinputsegmentlast);
\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);
  • Could you explain how this works at all?
    – A.Ellett
    Feb 19, 2013 at 0:33
  • @A.Ellett Look at the show path construction decoration into the pgf manual. Feb 19, 2013 at 0:38
  • That's what I've been doing. It still looks like magic to me.
    – A.Ellett
    Feb 19, 2013 at 0:43
  • The default arrow head of TikZ is not as sharp as that of PSTricks. (But it is not the point here) Feb 19, 2013 at 2:09
  • 1
    @GarbageCollector TikZ \neq PSTricks. You may use >=stealth... Feb 19, 2013 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.