|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Confused on how nodes/circles workHello 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 |
|
|
Re: Confused on how nodes/circles workDear 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 |
|
|
Re: Confused on how nodes/circles workOn Thu, 2009-10-22 at 08:11 -0400, Matthew Leingang wrote:
> 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. > Yes Matthew, I had tried the style before but I didn't know about the inner sep and outer sep so I did see some wierd big circle that wouldn't get smaller. :) So, [fill] circle (2pt) is basically a circle path, is that it? Thanks! > 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 |
|
|
Re: Confused on how nodes/circles workOn Oct 22, 2009, at 9:01 AM, Paulo J. Matos wrote: > On Thu, 2009-10-22 at 08:11 -0400, Matthew Leingang wrote: >> 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. >> > > Yes Matthew, I had tried the style before but I didn't know about the > inner sep and outer sep so I did see some wierd big circle that > wouldn't > get smaller. :) I was a victim of that gotcha for a long time once. It's reasonable that those separations are nonzero by default, since the usual use of node is to surround some text and without the separations it would look bad. But if all you want's the shape you have to remember the extra spacing. BTW, you could put the same options in your split style if the resulting rectangle doesn't have exactly what you want. I think the separation effect is more pronounced in circular nodes, however. > So, [fill] circle (2pt) is basically a circle path, is that it? That's correct. In my PGF 2.0 manual it's described in section 13.7. --Matthew -- 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 |
| Free embeddable forum powered by Nabble | Forum Help |