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'm trying to produce a graph in Tikz using the Simple style but the vertices won't get smaller than 6pt or so and I'd like them to be much smaller. The code looks like this and if you try it out, the vertices don't actually shrink to 2pt.

\begin{tikzpicture}
\GraphInit[vstyle=Simple]
\SetGraphUnit{1.5}
\tikzset{VertexStyle/.style = {shape = circle,fill = black,minimum size = 2pt}}
\Vertex{D}
\NOEA(D){A}
\SOEA(A){B}
\SOEA(D){C}
         % \Edges{A,B,C,D,A}
\Edges(A,B,C,D,A)
\end{tikzpicture}

Any ideas?

share|improve this question
2  
Try to also set the inner sep to a lower value, e.g. zero. –  Martin Scharrer Jun 21 '11 at 16:54
    
Worked out great, thanks! What is this parameter doing exactly, I'm not sure: is it to control the minimal size of the inside of nodes? –  David Kohler Jun 21 '11 at 17:22
    
It's not exactly with tikz but with tkz-graph. Yes it's based on TikZ but the syntax is different but you can mix the tkz code with TikZ code. I'm not sure that everybody understand the question. –  Alain Matthes Jun 21 '11 at 17:45
add comment

2 Answers

up vote 4 down vote accepted

You also need to set the inner sep value to 0pt. This parameter sets the inner separation between the node content (empty box in your case) and the official node border. The minimal size, however, controls the minimal height and width of the node content (only).

share|improve this answer
    
That "node content (only)" is misleading as it could refer to "only the text" (as in the previous sentence) or "whatever is inside the node boundary". The minimum size controls the minimum size including the inner sep but excluding the outer sep. Try \node[draw,inner sep=1cm,minimum size=3cm] (a) {}; \draw (a.north west) -- +(3,-3);. –  Andrew Stacey Jun 21 '11 at 18:33
add comment

Yes is it to control the minimal size of the inside of nodes by default I keep inner sep =2pt. You make a mistake with Edgesnow with the ctan version you need to use parenthesis (A,B,C,D). There is a macro to draw directly a square if you want.

\documentclass{scrartcl}

\usepackage{tkz-graph}

\begin{document}
    \begin{tikzpicture}
    \GraphInit[vstyle=Simple]
    \SetGraphUnit{1.5}
    \tikzset{VertexStyle/.style = {shape = circle,fill = black,minimum size = 2pt,inner sep=0pt}}
    \Vertex{D}
    \NOEA(D){A}
    \SOEA(A){B}
    \SOEA(D){C}
 \Edges(A,B,C,D,A)
    \end{tikzpicture} 
\end{document}  

enter image description here

to get a square : i use a circle because the nodes are on a circle :)

\begin{tikzpicture} 
\SetGraphUnit{2} 
\Vertices{circle}{A,B,C,D}
\end{tikzpicture}

enter image description here

share|improve this answer
    
thanks to you too! –  David Kohler Jun 21 '11 at 23:44
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.