Example: Node shapes

Published 2007-03-07 | Author: Kjell Magne Fauske

An overview of predefined node shapes. Note that only the rectangle and circle shapes are loaded by default. To use other shapes, load the shape library. The regular polygon and star shapes are only available for PGF >= v 1.18.

Download as: [PDF] [TEX]

Node shapes

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\begin{document}

\pagestyle{empty}

\begin{tikzpicture}[scale=2]
    \tikzstyle{ann} = [draw=none,fill=none,right]
    \matrix[nodes={draw, ultra thick, fill=blue!20},
        row sep=0.3cm,column sep=0.5cm] {
    \node[draw=none,fill=none] {Plain node}; &
    \node[rectangle] {Rectangle}; &
    \node[circle] {Circle};\\
    \node[ellipse] {Ellipse};&
    \node[circle split] {Circle \nodepart{lower} split};&
    \node[forbidden sign,text width=4em, text centered]
                    {Forbidden sign};\\
    \node[diamond] {Diamond};&
    \node[cross out] {Cross out};&
    \node[strike out] {Strike out};\\
    \node[regular polygon,regular polygon sides=5] {$n=5$};&
    \node[regular polygon,regular polygon sides=7] {$n=7$};&
    \node[regular polygon,regular polygon sides=9] {$n=9$};&
    \node[ann]{Regular polygon};\\
    \node[star,star points=4] {$p=4$};&
    \node[star,star points=7,star point ratio=0.8] {$p=7$};&
    \node[star,star points=10] {$p=9$};&
    \node[ann]{Star};\\
    };
\end{tikzpicture}


\end{document}

Comments

  • #1 snooc, November 3, 2009 at 4:54 p.m.

    how can i set the rim of a circle?

  • #2 James, November 15, 2009 at 11:19 p.m.

    How would I modify "\node[ellipse] {Ellipse};" if I wanted to specify the two radii?

  • #3 Kjell Magne Fauske, November 17, 2009 at 12:42 p.m.

    @James: You have to use the minimum width and minimum height options like this:

    \draw (0,0) node[ellipse, minimum height=2cm,minimum width=3cm,draw] {Ellipse};
    
  • #4 Michal Moc, March 7, 2010 at 1:47 p.m.

    It's posible split \nodepart{lower} verticaly in splic circle?

    For examlple http://www.iguru.eu/skola/critical_path.png

    Thank for you answer Michal.

  • #5 chuafahuo, June 11, 2010 at 11:14 a.m.

    Hello Sir or Miss: I want to plot flow chart with Tikz.I don't know how to plot parallelogram box,Could you tell me ?

  • #6 ofey, November 11, 2012 at 11:37 a.m.

    I copied and pasted the code, but I am getting the following error and am not sure what is means.

    texify.exe: Permission denied: puzzle.log texify.exe: Data: puzzle.log

    The did install the new package Any help would be greatly appreciated Thanks

  • #7 ofey, November 11, 2012 at 11:39 a.m.

    I should probably have mentioned that I am using MikTEX

Adding comments is currently not enabled.