When using different shapes from TikZ library, they have different inner padding for text. Thus, for similar text, we will have nodes (shapes) with different sizes. Then, the child nodes will not be similar, and the whole tree will be clumsy. What is the standard method to unify the shape sizes having similar text therein. Here is a simple example, displaying the significant difference of trapezium and triangle.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,trees}
\begin{document}
\begin{tikzpicture}
\node[circle,fill=blue] (par) at (0,0) {Parent}
[level distance=4cm,sibling angle=45,clockwise from=80]
child {node[regular polygon,regular polygon sides=3,fill=red] (child1) {Child 1}}
child {node[regular polygon,regular polygon sides=4,fill=yellow] (child2) {Child 2}}
child {node[trapezium,fill=green] (child3) {Child 3}};
\end{tikzpicture}
\end{document}
Best Answer
Here's an attempt to make the figure better:
As you can see, three things were modified:
minimum width=2.5cm,minimum height=2.5cm
you can insure the nodes won't shrink below a given sizelevel distance
to make things look better\tikzset{trapezium stretches=true}
. This solves the aspect ratio issue. Without this the trapezium would grow in width disproportionately to accommodate the limit imposed byminimum height
Do you like it?
EDIT: Ok, I got it now. You can reduce the padding by adding
\tikzset{every node/.style={inner sep=1pt]}
or any dimension you desire.EDIT2: Here we go again.
:)
The main challenge resides in the fact that there are various shapes for the nodes and each of them behaves differently, as you put it in your comment. I still believe you should set theminimum height
to some value, to make sure the trapezium and the circle don't shrink too much when you set theinner sep
to some negative value. Then you can correct the shape of the trapezium by forcing the base angles: