当我使用node
绘制矩形时[shape=rectangle]
,我设置minimum width=1pt
,然后我发现结果不是我期望的。
似乎minimum width/height
节点的不能小于某个值(关于7pt
这种情况,我没有测试其他情况)。
并且\path [...] (...) rectangle (...);
工作没有问题。
这是一个最小的工作示例:
\documentclass[tikz, border=0pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=1pt,y=1pt]
\path[clip] (0, 0) rectangle (30, 20);
% left-top rect with `rectangle`
\path [draw=black, fill=gray] (10,10) rectangle (17,17);
% unit rect with `rectangle`
\fill [draw=yellow, fill=cyan] (13,13) rectangle (14,14);
% bottom rect with `node shape`
\node [draw=green, fill=blue, shape=rectangle, minimum width=1pt, minimum height=1pt, anchor=north west] at (10,10) {};
% right rect with `node shape`
\node [draw=blue, fill=green, shape=rectangle, minimum width=1pt, minimum height=1pt, anchor=south west] at (17,10) {};
\end{tikzpicture}
\end{document}