3

I'm using these settings for most vertices:

\GraphInit[vstyle=Classic]
\tikzset{VertexStyle/.append style = {minimum size = 5pt, inner sep = 0pt}}

But I'd like to have one or two vertices of my graph be hollow with a thick outer edge. I'm very confused about what options can be used in \Vertex, which ones can go in \SetUpVertex, for which I have to use \tikzset, etc. What's the best option here?

2 Answers 2

4

Sorry I need to translate the documentation of tkz-graph. First hte main idea of this package is to provide useful and simple macros and styles to the users. Finally you have two style to know : VertexStyle and EdgeStyle. When you want to draw a graph, you can choice a "general" style with \GraphInit[vstyle=Classic]. This is useful if all your graphs have the same presentation and if inside a graphe, all the vertices have the same style. But you can change the style globally by hand and you can change locally the style.

There are some inconsistency but I need to adapt tkz-graph to pgf 2.1 and pgfkeys. With the new version, I will use only pgfkeys and I will add an english doc.

\documentclass[]{article}
\usepackage{tkz-graph}
\begin{document}

\begin{tikzpicture} 
% the next line  is because you want the style classic for most of the vertices
% if you can't find a style in the predefined styles then you create a style with
% \tikzset{VertexStyle/.style= ....
% if a predefined style is not exactly what you want you can use after the next line
% %\tikzset{VertexStyle/.append style = .....
% You also use : \SetUpVertex  \SetUpVertex[FillColor=red] 
%  \SetUpVertex is to avoid the use of \tikzset{VertexStyle/.append style ....   
\GraphInit[vstyle=Classic]
\SetUpVertex[FillColor=blue!30]  
\Vertex{A}
% with a scope you apply locally a new style but you can  use a tex group {....} instead.
\begin{scope}[VertexStyle/.append style = {minimum size = 5pt, 
                                           inner sep = 0pt,
                                           color=green}]
 \Vertex[x=4,y=2]{B}   
\end{scope}
% here I use  \tikzset
\tikzset{VertexStyle/.append style={rectangle}}
% Now if I want to put the label inside the vertex, I need to pass the style in the  
% options of Vertex with ,LabelOut=false.
% Logically, it's possible with \SetUpVertex but ...
\Vertex[x=4,y=-2,LabelOut=false]{C}  
\end{tikzpicture}    
\end{document}  

Conclusion

tkz-graph is useful if you want always the same type of graphs. There is some difficulties to if graphs ara not "homogeneous".

enter image description here

1
  • Thank you, this is really helpful! I hope some similar examples make it into the documentation when you translate it :)
    – jtbandes
    Feb 22, 2012 at 8:01
1

You could use something like:

\begin{tikzpicture}
\SetVertexNormal[LineWidth=3pt]
\Vertex{B}
\SetVertexNoLabel
\Vertex[x=1,y=0]{C}
\end{tikzpicture}  

vertices

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .