2

How to reduce the size of the Vertex in the following tkz-graph??

enter image description here

MWE:

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

\begin{tikzpicture}
\GraphInit[vstyle=Classic]
%
\Vertex[L=\hbox{$P_1$},x=2cm,y=0cm]{v0}
\Vertex[L=\hbox{$P_2$},style={left=.5cm},x=0cm,y=0.0cm]{v1}
\Vertex[L=\hbox{$P_3$},style={left=.5cm},x=0.0cm,y=2.5cm]{v2}
\Vertex[L=\hbox{$P_4$},x=2.0cm,y=2.5cm]{v3}
%

\tikzset{EdgeStyle/.style={post}}
\Edge[](v0)(v1)
\Edge[](v1)(v2)
\Edge[](v2)(v3)
\Edge[](v3)(v0)
\Edge[](v3)(v1)
%
\end{tikzpicture}   
\end{document}  
3

Unless you want to create a new style, you can play with minimum size and inner sep inside a append style key to modify predefined VertexStyle style.

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

\begin{tikzpicture}
\GraphInit[vstyle=Classic]
%
\tikzset{VertexStyle/.append style={minimum size=1pt, inner sep=1pt}}

\Vertex[L=\hbox{$P_1$},x=2cm,y=0cm]{v0}
\Vertex[L=\hbox{$P_2$},style={left=.5cm},x=0cm,y=0.0cm]{v1}
\Vertex[L=\hbox{$P_3$},style={left=.5cm},x=0.0cm,y=2.5cm]{v2}
\Vertex[L=\hbox{$P_4$},x=2.0cm,y=2.5cm]{v3}
%

\tikzset{EdgeStyle/.style={post}}
\Edge[](v0)(v1)
\Edge[](v1)(v2)
\Edge[](v2)(v3)
\Edge[](v3)(v0)
\Edge[](v3)(v1)
%
\end{tikzpicture}   
\end{document}  

enter image description here

  • I have tried with style ={inner sep = 1pt} in each vertex like \Vertex[L=\hbox{$\{1\}$},style ={inner sep = 1pt}]{v0}. I didnt get effect. But it didnt work whereas works well with ./append style..why?? – David Jun 7 '18 at 11:06
  • And if possible, how do i define this setup for the complete document where i have more than 30 graphs like this.. So that it will be easy for me style the vertices globally. – David Jun 7 '18 at 11:07
  • @David If you move GraphStyle and .append style to document preamble, they will be applied to all tikzpictures in your document. – Ignasi Jun 7 '18 at 14:45
  • @David graph-tkz is based on TikZ but it's a different package with different rules. It's documentation is written in french but it's full of examples and not too difficult to understand. – Ignasi Jun 7 '18 at 14:48
  • Thank you so much. I have read the documentation and there was no information about define globally in preamble. – David Jun 7 '18 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.