0

How can I fill the unbounded region between (A, B, C) with color red, I'm not talking about the triangle between these 3 lines, I'm talking about the region that is 3 way bounded by (A, B, C) with an opening in southwest direction

If possible can you give a more generalized answer for more lines, like 6 lines unbounded regions. Thank you

\documentclass[fleqn]{report}

\usepackage[left=2.0cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage[normalem]{ulem}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{setspace, graphicx, hyperref, pdfpages, color, xcolor, soul, wrapfig, titlesec, enumerate, amsmath, listings, enumitem, adjustbox, amssymb, mathtools, fancyhdr, tikz, forest, tikz-qtree, tkz-euclide, pgfplots}

\usetikzlibrary{shapes.geometric,fit}

\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
\newcommand{\sectionbreak}{\clearpage \setcounter{equation}{0} \setcounter{subsection}{0}}
\newcommand{\subsectionbreak}{\clearpage \setcounter{equation}{0}}
\renewcommand{\thesubsection}{\alph{subsection}}

\tikzstyle{l}=[color = black, domain = -8:8, samples = 100]


\onehalfspacing

\lstset{
  language=Python,
  % margins/spacing
  aboveskip=3mm,
  belowskip=3mm,
  tabsize=4,
  xleftmargin=1cm,
  showstringspaces=false,
  columns=flexible,
  % font styles
  basicstyle={\small\ttfamily},
  commentstyle=\color{black},
  % number/line separation
  breaklines=true,
  numbers=left,
  numbersep=5pt,
  %frame=single adds frame around code
}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{APM236 Assignment 1, Jiecao Wang \#997974811}
\fancyhead[R]{\today}
\renewcommand{\headrulewidth}{2pt}

\begin{document}

%%%%%%%%%%%%%%%%%%
%%% QUESTION 1 %%%
%%%%%%%%%%%%%%%%%%
  \begin{tikzpicture}
  \begin{axis}[
      axis x line=middle,
      axis y line=middle,
      axis equal,
      xtick={-8,-7,...,8},
      ytick={-8,-7,...,8},
      xlabel = {$x$},
      ylabel = {$y$},
      ymajorgrids=true,
      xmajorgrids=true,
      grid style=dashed,
      restrict y to domain = -8.5:8,
      restrict x to domain = -8.5:8,
    ]
    \addplot [l] { x + 2} node[pos=0.1,pin=100:{\color{blue}$A$}] {};
    \addplot [l] { 2 * x} node[pos=0.5,pin=0:{\color{green}$B$}] {};
    \addplot [l] { 6 - 3 * x} node[pos=0.8,pin=0:{\color{red}$C$}] {};
    
  \end{axis}
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.