答案1
简答。绘制三条线后,您知道交点 A(1,2)、B(2,0) 和 C(4,3)。因此添加以下行:
\fill[gray] (1,2)--(2,0)--(4,3)--cycle;
(几乎)完整的答案。
\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[font=\sffamily\small]
%
\draw[gray!20,step=0.5cm] (-6.5,-2) grid (6.5,6.5);
%
\draw[->,thick] (-6.6,0) -- (6.6,0) node[anchor=west]{$x$};
\draw[->,thick] (0,-2) -- (0,6.6) node[anchor=south]{$y$};
%
\foreach \x in {-6,-5,...,6} \draw [thick](\x cm,-2pt) -- (\x cm,2pt);
\foreach \y in {-2,-1,...,6} \draw [thick](-2pt,\y) -- (2pt,\y);
%
\foreach \x in {-6,-5,...,6} \draw (\x cm, 0 cm) node[anchor=north]{\x};
\foreach \y in {-2,-1,...,6} \draw (0 cm, \y cm) node[anchor=east]{\y};
\fill[gray] (1,2)--(2,0)--(4,3)--cycle;
\clip (-6.5,-2) rectangle (6.5,6.5);
\draw[cyan,line width=2pt] plot[domain=-6.5:6.5] (\x,{\x/3+5/3});
\draw[cyan,line width=2pt] plot[domain=-6.5:6.5] (\x,{-2*\x+4});
\draw[cyan,line width=2pt] plot[domain=-6.5:6.5] (\x,{3*\x/2-3});
\end{tikzpicture}
\end{center}
\结束{文档}
输出: