0
$\begingroup$

I have this two equations, and I want to solve them in a graphical way.

enter image description here

So, -I'm thinking- how can I plot them at the same time?

$\endgroup$

closed as off-topic by AccidentalFourierTransform, m_goldberg, Carl Lange, garej, LouisB May 21 at 10:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – AccidentalFourierTransform, m_goldberg, Carl Lange, garej, LouisB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Read the help articles on ContourPlot and Solve. They will show you the way. $\endgroup$ – David Keith May 20 at 0:08
  • 2
    $\begingroup$ Plot[{3-2x, (4-x)/3},{x,0,1}]? $\endgroup$ – AccidentalFourierTransform May 20 at 0:09
  • $\begingroup$ Thanks. If I have equations with more than one variable, how can I set the range for each variable. I mean in this case you propose for x range ,{x,0,1}; what happen if I have x, y, z, etc? $\endgroup$ – Haizum Skallah May 20 at 1:58
  • 1
    $\begingroup$ The option PlotRange can be used to set the range for both variables. $\endgroup$ – m_goldberg May 20 at 2:42
  • $\begingroup$ does ContourPlot[{2 x + y - 3 == 0, x + 3 y == 4}, {x, -1, 3}, {y, -1, 3}, FrameLabel -> (Style[#, 12, Bold] & /@ {x, y}), MeshFunctions -> {Boole[2 # + #2 == 3 && (# + 3 #2 == 4)] &}, Mesh -> {{1}}, MeshStyle -> {Directive[Red, PointSize[Large]]}, PlotLegends -> Placed["Expressions", {.8, .9}]] work in your version? $\endgroup$ – kglr May 20 at 5:14
2
$\begingroup$
pt = {x, y} /. Solve[{2 x + y - 3 == 0, x + 3 y == 4}, {x, y}][[1]]

(* {1, 1} *)

Legended[
 ContourPlot[
  {2 x + y - 3 == 0, x + 3 y == 4},
  {x, -1, 3}, {y, -1, 3},
  FrameLabel -> (Style[#, 12, Bold] & /@ {x, y}),
  Epilog -> {Red, AbsolutePointSize[4], Point[pt]}],
 Placed[
  LineLegend[
   {ColorData[97][1], ColorData[97][2]},
   {2 x + y - 3 == 0, x + 3 y == 4}], {.7, .7}]]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.