I created markov's chain using
tikz package. Now I would add to to it caption and label but I got error.How can I add a caption and a label to a tikz object?
In case you want to use floating environments, you will need to include the TikZ picture in a
If you don't want floats, see Gonzalo Medina's answer.
If you don't want the object to float, you can use, for example, a
If you want the object to be treated as a floating object, you can enclose it within a
A simple example illustrating both approaches: