Take the 2-minute tour ×
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.

I want to generate a regular polygon with 6 sides in TikZ. But I can not compile the following:

\begin{figure}
\resizebox{8 cm}{8 cm}{

\begin{tikzpicture}[scale=2]

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (2,2) {center \ node};

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (2,3.74) {adjacent \ node};

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (2,0.26) {adjacent \ node};

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (0.5,2.87) {adjacent \ node};

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (0.5,1.13) {adjacent \ node};

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (3.5,2.87) {adjacent \ node}; 

\node [draw, thick, minimum size=3cm, regular polygon, regular polygon sides=6] at (3.5,1.13) {adjacent \ node};
\end{tikzpicture}
}
\caption{Nodes placed  in hexagonal grid when ROI partitioned in to regular hexagons}
\end{figure}
share|improve this question
3  
Works fine here. As long as I use the shapes.geometric library that is. Did you forget that by any chance? If not, check your version of TikZ. –  Roelof Spijker Feb 4 '12 at 18:31
    
Exactly. I forgot to include that library. Thank you very much. –  user12290 Feb 5 '12 at 8:48
add comment

1 Answer 1

up vote 3 down vote accepted

You need to use the shapes.geometric library in order to use the regular polygon shape. After that your code should work just fine.

share|improve this answer
add comment

Your Answer

 
discard

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.