I am a beginner in LaTeX, but I am learning as I go. I want to plot the following linear programing problem:
(plot: to make a graphic)
f(x,y) = 2x - 3y -> max
x + y <= 12
x,y >=0
Here is what I have so far, but I can't find any good answers on how to draw it in LaTeX:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{hyperref}
\usepackage[latin1]{inputenc}
\title{Linear Programming}
\date{12/27/18}
\begin{document}
\maketitle
\bigbreak
a) \begin{cases} f(x,y) = 2x - 3y \rightarrow max \\x + y \leq 12 \\ x , y \geq 0 \end{cases}
\bigbreak
\bigbreak
\begin{tikzpicture}
\begin{axis}
[
xmin=-20,xmax=20,
ymin=-20,ymax=20,
grid=both,
grid style={line width=.1pt, draw=darkgray!10},
major grid style={line width=.2pt,draw=darkgray!50},
axis lines=middle,
minor tick num=4,
enlargelimits={abs=0.5},
axis line style={latex-latex},
samples=100,
domain = -20:20,
]
\addplot[red] {x + y <= 12};
\end{axis}
\end{tikzpicture}
\end{document}
Now the problem is I am only drawing lines when I should be drawing semi-planes ( x + y <= 12 with x and y > 0, should actually be a filled triangle)
What I want:
Can you help me out?




