# How can I shade part of a coordinate plane with tkz-euclide?

I'm graphing inequalities with tkz-euclide. I've figured out how to draw a dashed line on a coordinate grid, but I'm not sure how to shade it.

Here's what I have. How can I shade above or below the line?

\documentclass{article}
\usepackage{tkz-euclide} % coordinate plane
\begin{document}
\begin{tikzpicture}[scale=0.40,transform shape]
\tkzInit[xmax=6,ymax=6,xmin=-6,ymin=-6]
\tkzGrid
\tkzAxeXY
\draw[ very thick,dashed,latex-latex] (-6,4) -- (6,0);
\end{tikzpicture}
\end{document}


Since you are using TikZ commands already, you can do the shading with \fill. Here the opacity needs to be set to a low value, so the grid is still visible.

\documentclass{article}
\usepackage{tkz-euclide} % coordinate plane
\begin{document}
\begin{tikzpicture}[scale=0.40,transform shape]
\tkzInit[xmax=6,ymax=6,xmin=-6,ymin=-6]
\tkzGrid
\tkzAxeXY
\draw[ very thick,dashed,latex-latex] (-6,4) -- (6,0);
\fill[green,opacity=0.1] (-6,4) -- (6,0) -- (6,-6) -- (-6,-6) -- cycle;
\fill[red,opacity=0.1] (-6,4) -- (6,0) -- (6,6) -- (-6,6) -- cycle;
\end{tikzpicture}
\end{document}


• Or, you can fill first and draw later (instead of changing opacity. – balcinus Oct 11 '17 at 6:42
• @balcinus you could, but this would give you white rectangles around the numbers on the axis. – Mike Oct 11 '17 at 8:03
• I see. I guess that's because of the tkz-euclide macros used in the given code. – balcinus Oct 11 '17 at 13:10