0

I am trying to draw 2 somewhat complicated graphs with pgfplots but having a hard time. The first graph I am trying to draw is this graph:

enter image description here

Desmos version of it is available here

Issue with this is when I do \addplot[thick, black, samples=200, domain=0:2]{6 x + 2 y <= 19}; (for example) pgfplots does not like the fact that I have y in my equation. I have no idea how can I circumvent this or fix this as I really couldn't find any posts about this.

\begin{axis}[axis lines=center,
  xlabel=$x_{1}$,
  ylabel=$x_{2}$,
  xmin=-1,
  xmax=4.5,
  ymin=-1,
  ymax=5.5,
  xtick distance=1,
  ytick distance=1,
  clip=false,]
  \addplot[name path=A, thick, black, samples=200, domain=0:4]{6 x + 2 y <= 19};
  \addplot[name path=B, thick, black, samples=200, domain=0:4]{2 x + 3 y <= 13};
\end{axis}
\end{tikzpicture}

The other graph I've been attempting to draw is this:

enter image description here

Issue here is that I am unsure how to draw such a graph where the x and y axis deal with fractions like \frac{13}{3} or \frac{13}{4} etc.

I'd really appreciate any guidance I can get regarding these 2 graphs. Thanks in advance.

Arszilla
  • 139
  • Since you are not new here at TeX.SX you should already know that it really helps when you add an MWE or also a minimal not working example. Then we -- the helpers -- don't need to do everything, but can concentrate on solving your question. – Stefan Pinnow Feb 02 '21 at 18:01
  • Searching for [pgfplots] inequality here on TeX.SX gives several results that should be more than enough to solve your problem. Therefore I tend to close the question as duplicate. – Stefan Pinnow Feb 02 '21 at 18:04
  • @StefanPinnow I am aware but I saw no purpose of posting a code that doesn't work. I've attached it now, but the code doesn't work as I stated. I'll also take a look at the search query you posted, appreciated. – Arszilla Feb 02 '21 at 18:15
  • Also the issue with the post that is above this post (i.e duplicate of) is that it still deals with y on the other side of the equation. So it's y \ge x + 5 instead of 6x + 8y \le 11 for example. I'll still give it a read, but yeah. – Arszilla Feb 02 '21 at 18:23
  • Thank you for your understanding. In the unlikely case you shouldn't find the solution you are of course free to state it here. And if you find a more suitable "duplicate link" I'll be happy to change it. Good luck!! – Stefan Pinnow Feb 02 '21 at 18:30

0 Answers0