I'm creating a beamer presentation, in which I use TikZ.

I am making a figure, on which I would like to highlight something (using \only<> command). My figure contains an ellipse that is decorated with random steps:

\node[ellipse,minimum width=1cm,black!30,decorate,decoration={random steps,segment length=0.2cm,amplitude=.1cm}] {}; 
\node (n) at (0,0) {A};
\node (n) at (0,0) {B};

The ellipse is rendered in differenlty. How can I make it to render the same? or what other decoration can I use to get a similar effect to random steps?


The problem was due to the seed: if you add \pgfmathsetseed{<integer number>} before the first \node the seed used to generate random numbers is reset in each slide, forcing the path to be the same.

Here's a complete example (I took some liberty with the size of the shape):



\begin{frame}{Title frame}
\node[thick,draw,ellipse,minimum width=3cm,minimum height=1.5cm,black!30,decorate,decoration={random steps,segment length=0.3cm,amplitude=.3cm}] {}; 
\node (n) at (0,0) {A};
\node (n) at (0,0) {B};



enter image description here

  • Glad of having helped you. I would courteously suggest for the future to upvote all answers you find useful, including those to others' questions and to check/accept the best answers to your own questions by clicking the green tick on the left-hand side of the answer. Sep 7 '12 at 15:57
  • I'd love to upvote, but I don't have enough reputation yet :)
    – jfu
    Sep 7 '12 at 16:07
  • No problems: my comment should be intended as good recommendation for new users. :) Sep 7 '12 at 16:10
  • @ClaudioFiandrino How to get a closed curve?
    – Sigur
    Apr 1 '19 at 18:26
  • 1
    @Sigur: for that you have to operate on the decoration, try to fix the amplitude, segment length, (the path if you don't use a node construction). Apr 2 '19 at 10:08

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.