« Return to Thread: Confused on how nodes/circles work

Re: Confused on how nodes/circles work

by Matthew Leingang-3 :: Rate this Message:

Reply to Author | View in Thread

Dear Paulo,

There's a difference between circular paths and circular nodes.  If  
you want to refer to the objects later, nodes are the way to go.  Do  
the same thing as you have with "split" and make a node style.

\documentclass[11pt]{minimal}
\usepackage{tikz}
\usetikzlibrary
{shapes,arrows,trees,matrix,positioning,decorations.pathmorphing,scopes}
\usepackage[T1]{fontenc}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{1pt}%

\begin{document}
\begin{tikzpicture}[
  split/.style={
    rectangle,
    minimum size=2mm,
    solid,thick,draw=black!50,
    top color=white,
    bottom color=black},
  disk/.style={
    circle,
    minimum size=2pt,
    inner sep=0pt,
    outer sep=0pt,
    draw=black,fill=black}
  ]
  \node(init){}
  [every child node/.style={disk}]
  child { node (a) {}}
  child { node {}
    child { node {}
      child {node {}}
      child {node {}}
    }
    child {node [split] (b){}}
  }
  child {node {}};
  \draw[blue,dashed,->] (a)--(b);
\end{tikzpicture}
\end{document}

If you don't have the inner sep and outer sep options zeroed out, the  
extra space added will make the circles a lot bigger than 2pt.

Hope that helps!

--Matthew


On Oct 22, 2009, at 7:00 AM, Paulo J. Matos wrote:

> Hello all,
>
> I am quite confused with the usage of
> [fill] circle (2pt)
>
> Is this any 'syntactic sugar' for something else?
>
> Questions:
> - Below, the root shows up as a white space. Why? How can I add a  
> closed
> circle 2pt wide?
>
> - Below how can I name the circle nodes so that I can refer to them
> later?
>
> \documentclass[11pt]{minimal}
> \usepackage{tikz}
> \usetikzlibrary
> {shapes
> ,arrows,trees,matrix,positioning,decorations.pathmorphing,scopes}
> \usepackage[T1]{fontenc}
> \usepackage[active,tightpage]{preview}
> \PreviewEnvironment{tikzpicture}
> \setlength\PreviewBorder{1pt}%
>
> \begin{document}
> \begin{tikzpicture}[
>  split/.style={
>    rectangle,
>    minimum size=2mm,
>    solid,thick,draw=black!50,
>    top color=white,
>    bottom color=black}
>  ]
>  \node (init) {}
>  child {[fill] circle (2pt)}
>  child {[fill] circle (2pt)
>    child {[fill] circle (2pt)
>      child {[fill] circle (2pt)}
>      child {[fill] circle (2pt)}
>    }
>    child {node [split] {}}
>  }
>  child {[fill] circle (2pt)};
> \end{tikzpicture}
> \end{document}
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.pmatos.net
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users

--
Matthew Leingang
Clinical Associate Professor of Mathematics
leingang@...




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

 « Return to Thread: Confused on how nodes/circles work