Draw feasible region between constraints (TikZ and pgf) [closed]
2
0
I'm trying to shade the feasible region ABCDE but for some reason, only get a weird line. This is the code: begin{tikzpicture} % axes begin{axis}[axis on top,smooth, axis line style=very thick, axis x line=bottom, axis y line=left, ymin=0,ymax=17,xmin=0,xmax=17, xlabel=$x_1$, ylabel=$x_2$,grid=major ] % constraints draw [name path global=xaxis] (0,0) -- (17,0); draw [name path=yaxis] (0,0) -- (0,17); addplot[name path global=firstline,very thick, domain=0:17]{6-0.5*x}; addplot[name path global=secondline,very thick, domain=0:17]{3+0.5*x}; addplot[name path global=thirdline,very thick, domain=0:17]{16-2*x}; addplot[name path global=fourthline,very thick, domain=0:17]{7}; % feasible area fill[name intersections={of=xaxis and yaxis,by=point1}, name intersections={of=secondline and yaxis,by