Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to plot the following two functions to show points of intersection.

2 x + y - 1 == 0, 
x - y + 2 == 0
ContourPlot[{2 x + y - 1 == 0, x - y + 2 == 0}, {x, -5, 5}, {y, -5, 5}]

The above shows the plots, but I find it difficult to see the point of intersection. I suspect that there is a better method than this.

Please suggest a good method to plot such equations.

share|improve this question
The intersection is the point where both lines meet. What difficulties do you have to see it? – Dr. belisarius May 1 '13 at 1:43
True. I am unable to highlight the point and show its co-ordinates. I have looked at an approach in the following question. Is there a similar method that can be used here ?…. – user7210 May 1 '13 at 1:53
@user7210 are you looking for more than is in my answer? – Jonathan Shock May 3 '13 at 1:19

If you want to know the value of the points then you can use Solve. If you want to be able to see the intersection point highlighted then you can add a point at that value of x and y:

eqs = {2 x + y - 1 == 0, x - y + 2 == 0}
sol = {x, y} /. Solve[eqs, {x, y}]
Show[ListPlot[sol, PlotStyle -> PointSize -> 0.02],ContourPlot[Evaluate[eqs], {x, -5, 5}, {y, -5, 5}]]
share|improve this answer
Thanks. This works! – user7210 May 1 '13 at 2:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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