答案1
考虑以下代码:
\documentclass[border={1mm 1mm 1mm 1mm}]{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}[scale=0.6]
\draw[->] (-4.5,0) -- (1.5,0);
\draw[->] (0,-4.5) -- (0,4.5);
\foreach \x in {-4,-3,-2,-1,0,1}
\draw (\x cm,1.5pt) -- (\x cm,-1.5pt);
\foreach \y in {-4,-3,-2,-1,0,1,2,3,4}
\draw (1.5pt,\y cm) -- (-1.5pt,\y cm);
\draw[thick,red,pattern=north east lines,pattern color=red] (-4,-4) -- (0,0)--(-4,4);
\draw[draw=none,red,pattern=north west lines,pattern color=blue] (0,0)--(-4,4) to[in=150,out=0] (4,2)--(4,-2)to[in=0,out=200](-4,-4) --(0,0);
\end{tikzpicture}
\end{document}
结果如下:
如果您考虑最后一行代码,您可以轻松地自定义外部区域的边界。