Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

By default, when I plot a graph, the axis seems to be at the lower limit

x=linspace(-10,10,20)
y=4*x+2
plot(x,y)

How can I have the axis when x=0 & y=0, for example below

UPDATE

If its not possible to use real "axis", I am thinking of plotting the graphs x=0 & y=0 for the y & x axis respectively, how might I do that?

Then isit possble to show where they intersect? like in format like (x, y) eg. (0, 2)

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

It seems that this is not (easily) possible. For your information: I found the following links:

share|improve this answer
    
Thanks, I am trying to plot graphs of x=0 and y=0 to simulate the y & x axis, how might I do that? See updated post/question –  Jiew Meng Aug 28 '11 at 6:16
add comment

try this:

set (gca, "xaxislocation", "zero");

set (gca, "yaxislocation", "zero");

It works only for Octave, not Matlab. Would be interesting also to know how do this with matlab.

share|improve this answer
add comment

Your Answer

 
discard

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.