Tikz offers snake decoration, which is however not pure sine decoration. As written in Tikz manual, snake is "sine wave with a softened start and ending". I would like to have pure sine decoration.

I am aware that there is a solution for complete sines, which always draws full number of sines:

TikZ finishes a morphed path with a straight segment

The problem is that I want that line gets straight if sines do not fit in. Ie.

\draw [decoration={sines,segment length=1cm,amplitude=1cm},decorate] (0,0) -- (0,1.6cm);

should draw 1.5 sines and straight line 0.1cm long. It should also work with pre length and post length, just as snake does.

I guess this should be simpler that complete sines, but I don't know how to tweak @Jake's solution to my needs.

  • Does the post tikz-decorated-paths-without-straight-segment answer your question?
    – user30471
    Sep 22, 2014 at 7:41
  • @Andrew no. I want to have possibility of straight segment in the beginning and/or in the end of the decoration. start up and start down is nice feature, though :)
    – Pygmalion
    Sep 22, 2014 at 7:56
  • I don't see any reason this should be closed. It seems sufficiently clear and not solved. An MWE would be nice, so the question could certainly be improved. But I don't think that's sufficient to close it, is it?
    – cfr
    Oct 3, 2015 at 21:19


Your Answer

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

Browse other questions tagged or ask your own question.