# LaTeX color package: wrong spacing

I'm making a simple drawing, on which high school students have to complete the drawing.It's a drawing in R², so I also made a raster. If I use black lines for my raster, it is too dark, so I loaded the color package and changed the color to cyan. But the lines that are colored got shifted by about 1mm.

The weird thing is, if I remove the color for the horizontal lines, the vertical lines are blue but correctly placed. If I make the Horizontal lines blue, the vertical ones or shifted. The only change in code I make is commenting out the color.

\begin{picture}(82,100)
\linethickness{0.02mm}
\textcolor{cyan}
{\multiput(0,0)(5,0){17}%
{\line(0,1){100}}}
\textcolor{cyan}
{\multiput(0,0)(0,5){21}%
{\line(1,0){80}}}
\linethickness{0.3mm}
\multiput(10,9)(10,0){7}%
{\line(0,1){2}}
\multiput(19,10)(0,10){9}%
{\line(1,0){2}}
\linethickness{0.3mm}
\put(20,0){\vector(0,1){98}}
\put(0,10){\vector(1,0){78}}
\put(0,10){\line(2,1){80}}
\put(40,80){\circle*{0.6}}
\put(28,21){$r$}
\put(41,81){$P$}
\put(6,5){$-1$}
\put(16,5){$0$}
\put(29,5){$1$}
\put(39,5){$2$}
\put(49,5){$3$}
\put(59,5){$4$}
\put(69,5){$5$}
\put(74,5){$x$}
\put(16,18){$1$}
\put(16,28){$2$}
\put(16,38){$3$}
\put(16,48){$4$}
\put(16,58){$5$}
\put(16,68){$6$}
\put(16,78){$7$}
\put(16,88){$8$}
\put(16,94){$y$}
\end{picture}


\begin{picture}(82,100)
\linethickness{0.02mm}
\textcolor{cyan}
{\multiput(0,0)(5,0){17}%
{\line(0,1){100}}}
%\textcolor{cyan}
{\multiput(0,0)(0,5){21}%
{\line(1,0){80}}}
\linethickness{0.3mm}
\multiput(10,9)(10,0){7}%
{\line(0,1){2}}
\multiput(19,10)(0,10){9}%
{\line(1,0){2}}
\linethickness{0.3mm}
\put(20,0){\vector(0,1){98}}
\put(0,10){\vector(1,0){78}}
\put(0,10){\line(2,1){80}}
\put(40,80){\circle*{0.6}}
\put(28,21){$r$}
\put(41,81){$P$}
\put(6,5){$-1$}
\put(16,5){$0$}
\put(29,5){$1$}
\put(39,5){$2$}
\put(49,5){$3$}
\put(59,5){$4$}
\put(69,5){$5$}
\put(74,5){$x$}
\put(16,18){$1$}
\put(16,28){$2$}
\put(16,38){$3$}
\put(16,48){$4$}
\put(16,58){$5$}
\put(16,68){$6$}
\put(16,78){$7$}
\put(16,88){$8$}
\put(16,94){$y$}
\end{picture}

-
Welcome to TeX.sx! :) –  Paulo Cereda Oct 15 '11 at 10:55
Thanks, I wasn't able to add the screenshots (a missing privilege). –  sanderd17 Oct 15 '11 at 11:35

You have two spurious spaces

\begin{picture}(82,100)
\linethickness{0.02mm}
\textcolor{cyan}
{\multiput(0,0)(5,0){17}%
{\line(0,1){100}}}% <<<<<<< Otherwise a space will appear
\textcolor{cyan}
{\multiput(0,0)(0,5){21}%
{\line(1,0){80}}}% <<<<<<< Otherwise a space will appear
\linethickness{0.3mm}
...

-
+1. Picture environments were my first exposure to the insidious effects of spurious spaces in my LaTeX source! –  Niel de Beaudrap Oct 15 '11 at 11:20
Thanks for the fast reply. It worked –  sanderd17 Oct 15 '11 at 11:31