0
$\begingroup$

Try to plot this graph.

A = {2 x + 2 y == 8, 5 x + 3 y == 15, x == 0, y == 0}; ContourPlot[A, {x, 0, 5}, {y, 0, 5}]

I only get a blank plane, no sign of these 2 linear equations.

$\endgroup$
  • 3
    $\begingroup$ ContourPlot holds its first argument, so use ContourPlot[Evaluate @ A, {x, 0, 5}, {y, 0, 5}]. $\endgroup$ – Carl Woll Aug 1 at 15:44
  • $\begingroup$ Thank you. Carl Woll. Is there any other way to do this? $\endgroup$ – kile Aug 1 at 22:17
  • $\begingroup$ You could always do With[{A = {2 x + 2 y == 8, 5 x + 3 y == 15, x == 0, y == 0}}, ContourPlot[A, {x, 0, 5}, {y, 0, 5}]] $\endgroup$ – J. M. will be back soon Aug 2 at 7:48
1
$\begingroup$

Just an addition to @CarlWoll's comment :

The conditions x==0,y==0 aren't shown because they lie on the border of the plotting range. Try

ContourPlot[ Evaluate@A, {x, -.1 , 5}, {y, -.1 , 5}, PlotRange -> All ]

enter image description here

to show all 4 contours.

$\endgroup$

Your Answer

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

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