TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To create something that looks like the shape of a lake, the following code transforms the border of a blue ellipse with smooth random steps. The idea is taken from another answer.

% The seed is only set explicitly to always generate the same picture.
% The problem occurs independent of seed.

  \fill[blue, draw=brown,
    decoration={random steps,segment length=1cm,amplitude=.5cm},
    rounded corners=.3cm
  ] (0, 0) ellipse (3 and 2);
  \draw[ultra thick, red] (3.1, 0) circle (.3);

enter image description here

As marked with a red circle, at the point where the ellipse begins (at 0 degrees) the random step is not correctly smoothed but adds an ungly corner. How can this be fixed?

share|improve this question
up vote 11 down vote accepted

You can use the options pre and post to control what's happening at the beginning and the end of the path you're decorating. More information in the Tikz/PGF manual, section 21.4.2, page 247.

I suggest this:

decoration={random steps,segment length=1cm,amplitude=.5cm,
            pre=lineto,pre length=.25cm,post=lineto,post length=.25cm}

A complete source file and the result follow.


    \fill[blue, draw=brown,
      decoration={random steps,segment length=1cm,amplitude=.5cm,#1},
      rounded corners=.3cm
    ] (0, 0) ellipse (3 and 2);
  \textbf{Seed #1} \\
    \rndellipse{#1} &
    \rndellipse[pre=lineto,pre length=.25cm,post=lineto,post length=.25cm]{#1}



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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