TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

Inspired by the suggestion to use the plot function and and some randomly generated points in

Which package can easily write a graph, as an arbitrary curve or area, just for indication

(the answer from March 15, 2011), I now manage to make arbitrary shapes. However, I would like to fill these with different colors, and I suppose the fill-command in TikZ can be applied - but don't manage to do it.

Does anyone know how this can be done?

The code for the arbitrary shape is

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm, scale = 0.47]

\draw plot [smooth cycle, samples=8,domain={1:8}] (\x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) {};

share|improve this question
up vote 5 down vote accepted

You have to supply the fill options to the \draw command

\draw[fill=blue] plot [smooth cycle, samples=8,domain={1:8}]
     (\x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) {};
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.