点阵尺寸不断增大

点阵尺寸不断增大

我的一个朋友问我是否可以创建一个点尺寸不断增加的点网格,如图所示(没有图标):

在此处输入图片描述

我知道网上有很多 tikz-dotgrids 可供查找。但我不知道如何增加点的大小。

我认为我需要每行的点数、点的起始和终止大小以及它们之间的距离。但我不知道如何将这些参数组合成一个漂亮的点网格。

答案1

是的。

\documentclass[border=3.14mm,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \X in {1,...,50}
{\foreach \Y in {1,...,50}
\fill (\X*8pt,-\Y*8pt) circle ({(1+0.5*veclen(\X,\Y))*0.1pt});
 }
\end{tikzpicture}
\end{document}

在此处输入图片描述

编辑:只是为了好玩,也为了 J. Leon V. ;-)

\documentclass[border=3.14mm,tikz]{standalone}
\usetikzlibrary{shadings}
\begin{document}
\foreach \Z in {0,30,...,330}
{\begin{tikzpicture}
\clip (0,0) circle (25.5*8pt);
\shade[shading=color wheel,even odd rule,transform canvas={rotate=\Z}] 
foreach \X in {-25,...,25}
{foreach \Y in {-25,...,25}
{ (\X*8pt,-\Y*8pt) circle ({(1+12*(1.2+sin(\Z+50*veclen(\X,\Y))))*0.1pt})
}
};
\end{tikzpicture}}
\end{document}

在此处输入图片描述

答案2

来自径向@marmot 的精彩答案的线性选项变化。

结果:

在此处输入图片描述

梅威瑟:

\documentclass[border=20pt,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
    \foreach \X in {1,...,50}{
        \foreach \Y in {1,...,50}{
            \fill (\X*10pt,-\Y*10pt) circle ({(\X+\Y+5)*0.05pt});
        }
     }
    \end{tikzpicture}
\end{document}

附录

在遭受一些附带损害之后,我只看到到处都是土拨鼠……

在此处输入图片描述

梅威瑟:

\documentclass[border=20pt,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
    \foreach \Line [count=\y from 0] in {
    {1,1,2,2,1,1,1,1,1,12,53,4,1,2,1,4,5,48,13,1,5,1,4,1,1,1,1,1,1,1},
    {1,2,2,1,1,5,3,2,5,81,202,112,42,89,86,36,75,198,128,7,1,4,1,2,1,1,1,1,1,1},
    {1,4,2,1,3,1,1,1,6,139,208,188,188,200,209,202,172,201,195,4,1,1,2,1,1,1,1,1,1,1},
    {1,1,1,4,2,1,1,2,1,150,179,159,164,171,185,193,214,220,158,1,4,1,1,1,1,1,1,1,1,1},
    {4,1,1,2,1,1,4,2,5,121,155,142,140,163,172,188,187,215,152,9,1,1,7,1,1,1,1,1,1,1},
    {2,1,3,1,1,3,1,1,85,147,125,140,153,141,152,175,202,196,216,89,4,1,1,2,1,1,1,1,1,1},
    {1,1,5,1,2,2,1,25,140,117,107,179,171,119,141,179,212,201,214,190,20,1,5,1,1,1,1,1,1,1},
    {1,1,4,1,4,1,8,77,140,106,82,98,104,137,168,159,178,185,199,227,90,2,1,3,1,1,1,1,1,1},
    {2,2,1,1,2,1,11,133,124,80,68,63,107,190,235,173,163,183,198,217,172,1,2,2,1,1,1,1,1,1},
    {1,2,1,2,4,3,46,148,112,76,47,79,69,144,183,163,183,188,196,216,205,43,2,1,1,1,1,1,1,1},
    {1,2,1,2,2,1,89,154,101,67,67,143,95,71,109,171,199,192,195,208,229,98,1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,126,150,119,73,60,129,177,178,185,198,187,188,195,203,230,146,2,2,1,1,1,1,1,1},
    {2,1,1,2,2,14,156,149,109,94,74,68,106,138,152,154,167,183,199,205,221,186,12,1,1,1,1,1,1,1},
    {3,1,1,1,1,33,173,152,126,98,94,95,118,131,146,161,170,190,201,207,215,210,28,1,1,1,1,1,1,1},
    {3,1,1,1,1,55,186,169,140,115,109,109,118,122,145,165,176,193,199,209,223,222,42,1,1,1,1,1,1,1},
    {2,1,3,1,2,75,201,191,194,146,76,63,63,83,110,141,167,184,196,215,241,229,50,1,1,1,1,1,1,1},
    {3,2,1,1,1,96,211,114,150,206,67,23,42,59,88,123,158,165,121,176,236,237,70,1,1,2,1,2,1,2},
    {1,1,2,2,4,97,207,149,161,233,114,10,32,47,83,117,146,170,132,173,231,245,83,3,1,3,4,1,1,5},
    {2,2,2,1,7,100,214,198,196,246,180,33,46,57,82,115,148,204,196,211,235,240,79,1,1,1,1,5,3,1},
    {3,2,1,1,4,96,222,214,232,248,192,50,59,74,97,129,151,213,236,234,231,235,73,5,1,6,1,3,1,1},
    {1,1,1,2,1,83,223,199,226,243,167,79,91,100,121,143,158,203,244,233,225,233,60,1,3,1,3,1,2,1},
    {1,2,1,3,1,60,220,200,173,181,136,120,126,131,143,158,168,184,212,208,224,229,44,1,1,64,58,2,4,7},
    {2,3,1,1,1,30,202,219,185,167,155,159,153,155,162,175,191,192,202,212,236,206,22,19,133,248,59,3,1,3},
    {1,2,1,1,2,3,174,226,200,191,182,174,174,174,182,185,191,202,206,218,233,196,90,191,256,148,10,1,1,1},
    {1,2,4,1,1,4,99,235,214,204,197,193,193,191,189,200,204,208,217,228,234,216,220,241,146,8,3,2,2,3},
    {3,1,1,1,4,1,17,186,231,219,210,202,201,206,208,212,211,221,221,231,231,205,155,67,1,4,1,1,1,1},
    {1,5,2,2,4,1,8,34,210,220,229,221,215,220,219,217,219,229,236,219,88,23,5,1,1,1,2,1,1,2},
    {1,1,1,1,2,9,1,77,155,186,213,220,229,236,230,229,226,221,229,226,89,1,1,7,1,2,1,1,1,1},
    {2,1,5,4,1,1,3,136,222,208,227,256,227,144,143,231,244,227,242,254,143,14,1,1,1,2,1,1,1,1},
    {1,3,1,1,8,4,1,3,65,99,115,94,52,7,3,47,92,109,103,57,1,1,10,1,1,1,2,1,1,2}% Yes this percent is suspicious...
    }{
        \foreach \pixel [count=\x from 0] in \Line {
            \ifnum\pixel<20
                \fill (\x*10pt,-\y*10pt) circle (20*0.025pt);
            \else
                \fill (\x*10pt,-\y*10pt) circle (\pixel*0.025pt);
            \fi
        }
     }
    \end{tikzpicture}
\end{document}

PSD:为了获取我使用的土拨鼠图标数据LCD 图像转换器,然后使用 Excel 进行一些文本操作来获取十进制值。


附录 2

为了你的朋友;)...将每个点声明为 10x10pt 大小的矩形,使用数据数组中的值控制黑色填充。

结果:

在此处输入图片描述

梅威瑟:

% arara: pdflatex: {synctex: yes, action: nonstopmode}
\documentclass[border=20pt,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
    \foreach \Line [count=\y from 0] in {
    {1,1,2,2,1,1,1,1,1,12,53,4,1,2,1,4,5,48,13,1,5,1,4,1,1,1,1,1,1,1},
    {1,2,2,1,1,5,3,2,5,81,202,112,42,89,86,36,75,198,128,7,1,4,1,2,1,1,1,1,1,1},
    {1,4,2,1,3,1,1,1,6,139,208,188,188,200,209,202,172,201,195,4,1,1,2,1,1,1,1,1,1,1},
    {1,1,1,4,2,1,1,2,1,150,179,159,164,171,185,193,214,220,158,1,4,1,1,1,1,1,1,1,1,1},
    {4,1,1,2,1,1,4,2,5,121,155,142,140,163,172,188,187,215,152,9,1,1,7,1,1,1,1,1,1,1},
    {2,1,3,1,1,3,1,1,85,147,125,140,153,141,152,175,202,196,216,89,4,1,1,2,1,1,1,1,1,1},
    {1,1,5,1,2,2,1,25,140,117,107,179,171,119,141,179,212,201,214,190,20,1,5,1,1,1,1,1,1,1},
    {1,1,4,1,4,1,8,77,140,106,82,98,104,137,168,159,178,185,199,227,90,2,1,3,1,1,1,1,1,1},
    {2,2,1,1,2,1,11,133,124,80,68,63,107,190,235,173,163,183,198,217,172,1,2,2,1,1,1,1,1,1},
    {1,2,1,2,4,3,46,148,112,76,47,79,69,144,183,163,183,188,196,216,205,43,2,1,1,1,1,1,1,1},
    {1,2,1,2,2,1,89,154,101,67,67,143,95,71,109,171,199,192,195,208,229,98,1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,126,150,119,73,60,129,177,178,185,198,187,188,195,203,230,146,2,2,1,1,1,1,1,1},
    {2,1,1,2,2,14,156,149,109,94,74,68,106,138,152,154,167,183,199,205,221,186,12,1,1,1,1,1,1,1},
    {3,1,1,1,1,33,173,152,126,98,94,95,118,131,146,161,170,190,201,207,215,210,28,1,1,1,1,1,1,1},
    {3,1,1,1,1,55,186,169,140,115,109,109,118,122,145,165,176,193,199,209,223,222,42,1,1,1,1,1,1,1},
    {2,1,3,1,2,75,201,191,194,146,76,63,63,83,110,141,167,184,196,215,241,229,50,1,1,1,1,1,1,1},
    {3,2,1,1,1,96,211,114,150,206,67,23,42,59,88,123,158,165,121,176,236,237,70,1,1,2,1,2,1,2},
    {1,1,2,2,4,97,207,149,161,233,114,10,32,47,83,117,146,170,132,173,231,245,83,3,1,3,4,1,1,5},
    {2,2,2,1,7,100,214,198,196,246,180,33,46,57,82,115,148,204,196,211,235,240,79,1,1,1,1,5,3,1},
    {3,2,1,1,4,96,222,214,232,248,192,50,59,74,97,129,151,213,236,234,231,235,73,5,1,6,1,3,1,1},
    {1,1,1,2,1,83,223,199,226,243,167,79,91,100,121,143,158,203,244,233,225,233,60,1,3,1,3,1,2,1},
    {1,2,1,3,1,60,220,200,173,181,136,120,126,131,143,158,168,184,212,208,224,229,44,1,1,64,58,2,4,7},
    {2,3,1,1,1,30,202,219,185,167,155,159,153,155,162,175,191,192,202,212,236,206,22,19,133,248,59,3,1,3},
    {1,2,1,1,2,3,174,226,200,191,182,174,174,174,182,185,191,202,206,218,233,196,90,191,256,148,10,1,1,1},
    {1,2,4,1,1,4,99,235,214,204,197,193,193,191,189,200,204,208,217,228,234,216,220,241,146,8,3,2,2,3},
    {3,1,1,1,4,1,17,186,231,219,210,202,201,206,208,212,211,221,221,231,231,205,155,67,1,4,1,1,1,1},
    {1,5,2,2,4,1,8,34,210,220,229,221,215,220,219,217,219,229,236,219,88,23,5,1,1,1,2,1,1,2},
    {1,1,1,1,2,9,1,77,155,186,213,220,229,236,230,229,226,221,229,226,89,1,1,7,1,2,1,1,1,1},
    {2,1,5,4,1,1,3,136,222,208,227,256,227,144,143,231,244,227,242,254,143,14,1,1,1,2,1,1,1,1},
    {1,3,1,1,8,4,1,3,65,99,115,94,52,7,3,47,92,109,103,57,1,1,10,1,1,1,2,1,1,2}% Yes this percent is suspicious...
    }{
        \foreach \pixel [count=\x from 0] in \Line {
            \pgfmathparse{int(\pixel/256*100)}
            \edef\op{\pgfmathresult}
            \ifnum\op<20
                \fill[black!10] (\x*10pt,-\y*10pt) rectangle ++(10pt, 10pt);
            \else
                \fill[black!\op] (\x*10pt,-\y*10pt) rectangle ++(10pt,10pt);
            \fi
        }
     }
    \end{tikzpicture}
\end{document}

相关内容