Hmm, hab mir die Sache nochmal angesehen. Sieht in der ersten Version nicht in allen Zoomstufen gleich aus, also doch lieber so:
Code:
\documentclass{article}
\usepackage{pst-all}
\begin{document}
\psset{xunit=30pt,yunit=30pt,runit=30pt}
\begin{pspicture}(-1,0)(10,11)
\multido{\Ny=0.0+1.0}{11}{\psline(0,\Ny)(10,\Ny)}
\multido{\Nx=0.0+1.0}{11}{\psline(\Nx,0)(\Nx,10)}
\multido{\Nx=1.0+1.0,\Ny=1.0+1.0}{10}{\psline(0,\Ny)(\Nx,0)}
\multido{\Nx=1.0+1.0,\Ny=1.0+1.0}{10}{\psline(\Nx,10)(10,\Ny)}
\pspolygon*(2,7)(4,7)(9,2)(7,2)
\multido{\Ny=.5+1.0}{10}{\rput{0}(-.5,\Ny){\Ny}}
\multido{\Nx=.5+1.0}{10}{\rput{0}(\Nx,10.5){\Nx}}
\end{pspicture}
\end{document}
oder gleich richtig kompliziert und mittels Konstanten komplett skalierbar:
Code:
\documentclass{article}
\usepackage{pst-all,ifthen}
\begin{document}
\newcommand{\cols}{10} % Spaltenanzahl
\newcommand{\rows}{10} % Zeilenanzahl
\newcommand{\xoffs}{1.0}
\newcommand{\yoffs}{1.0}
\newcommand{\xpos}{0}
\newcommand{\ypos}{0}
\FPadd{\cols}{1}{\ctimes}
\FPadd{\rows}{1}{\rtimes}
\psset{xunit=30pt,yunit=30pt,runit=30pt}
\begin{pspicture}(-1,0)(\cols,\rtimes)
\multido{\Ny=0.0+1.0}{\rtimes}{\psline(0,\Ny)(\cols,\Ny)}
\multido{\Nx=0.0+1.0}{\ctimes}{\psline(\Nx,0)(\Nx,\rows)}
\ifthenelse{\cols < \rows}{
\newcommand{\diagcount}{\cols}
\FPsub{\rows}{\cols}{\yoffs}
\FPadd{\yoffs}{1.0}{\yoffs}
\FPadd{\yoffs}{\diagcount}{\ypos}
\FPsub{\ypos}{1.0}{\ypos}
\renewcommand{\xpos}{\diagcount}
\FPsub{\rows}{\cols}{\left}
\FPadd{\diagcount}{1.0}{\Nya}
\multido{\Nya=\Nya+1.0,\Nyb=1.0+1.0}{\left}{\psline(0,\Nya)(\cols,\Nyb)}
}{%
\newcommand{\diagcount}{\rows}
\FPsub{\cols}{\rows}{\xoffs}
\FPadd{\xoffs}{1.0}{\xoffs}
\FPadd{\diagcount}{\xoffs}{\xpos}
\FPsub{\xpos}{1.0}{\xpos}
\renewcommand{\ypos}{\diagcount}
\FPsub{\cols}{\rows}{\left}
\FPadd{\diagcount}{1.0}{\Nxb}
\multido{\Nxa=1.0+1.0,\Nxb=\Nxb+1.0}{\left}{\psline(\Nxa,\rows)(\Nxb,0)}
}
\multido{\Nx=1.0+1.0,\Ny=1.0+1.0}{\diagcount}{\psline(0,\Ny)(\Nx,0)}
\multido{\Nx=\xoffs+1.0,\Ny=\yoffs+1.0}{\diagcount}{\psline(\Nx,\ypos)(\xpos,\Ny)}
\pspolygon*(1,3)(3,3)(5,1)(3,1)
\FPadd{\rows}{.5}{\yoffs}
\multido{\Ny=.5+1.0}{\rows}{\rput{0}(-.5,\Ny){\Ny}}
\multido{\Nx=.5+1.0}{\cols}{\rput{0}(\Nx,\yoffs){\Nx}}
\end{pspicture}
\end{document}
Grüße,
Marcel
Lesezeichen