1

I've found code to create the Brownian motion graph -

\newcommand{\Emmett}[5]{% points, advance, rand factor, options, end label
\draw[#4] (0,0)
\foreach \x in {1,...,#1}
{   -- ++(#2,rand*#3)
}
node[right] {#5};
}

\begin{tikzpicture}
\draw[help lines] (0,-5) grid (15,5);
\Emmett{750}{.02}{0.2}{red}{first one}
\end{tikzpicture}

I want to label to graph as shown in my picture, but I need to graph to remain the same each time I compile so that my arrows don't get messed up. How would I go about keeping the graph from changing and labeling? Pic

Torbjørn T.
  • 206,688
  • 2
    Hi, welcome. Try adding \pgfmathsetseed{42} (or some other number) before \draw in your macro (similar to https://tex.stackexchange.com/questions/422375/duplicate-irregular-lines/422376#422376). – Torbjørn T. Apr 04 '18 at 21:29
  • Sorry: nobody can compile your code without guessing what your preamble might have been ... or not . Please complete the code, e.g. via: https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that/10137#10137 . Thank you – MS-SPO Mar 25 '24 at 19:52

0 Answers0