[pstricks] grid as background in an environment
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Thu Oct 9 13:55:53 CEST 2003
Martin Buchmann schrieb:
> That's working better than i expected at first but there is a small
> problem because \psgrid takes integer values as coordinates. How can i
> convert the size of my box into coordinates for psgrid so that the grid
> is never to small?
draw the grid by yourself.
Herbert
\makeatletter
\newcount\xLines \xLines=20
\newcount\yLines \yLines=4
\newcommand\grid[2]{{%
\newdimen\xMax \xMax=#2%
\newdimen\yMax \yMax=#1%
\newdimen\dx \dx=\xMax \divide\dx by \xLines%
\newdimen\dy \dy=\yMax \divide\dy by \yLines%
\psset{unit=1pt, linecolor=yellow}%
\advance\xLines by 1%
\advance\yLines by 1%
\multido{\rA=0+\strip at pt\dx}{\xLines}{\psline(\rA,0)(\rA,\yMax)}%
\multido{\rA=0+\strip at pt\dy}{\yLines}{\psline(0,\rA)(\xMax,\rA)}%
}}
\makeatother
>
> Thanks
> Martin
>
--
http://www.pstricks.de/
More information about the PSTricks
mailing list