The following code
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path [style={draw}] (0,0) rectangle (4,1);
\path [style={draw}] (0,1) rectangle (4,2);
\path [style={draw,thick,fill=orange}] (0,1) rectangle (1,2);
\end{tikzpicture}
\end{document}
Produces an image like this:

On closer observation one can see that the rectangles don't intersect properly on the border (drawn a bit exaggerated for better visibility):
Is there a way to make the rectangles fit perfectly? I know that adding/subtracting 0.01 to some coordinates works but that isn't really a clean fix.



thick? Or usethickfor all of the rectangles? If you need variable thicknesses, you could specify them so that you can compensate appropriately. – cfr Aug 22 '14 at 21:17