Focal length of converging thin lens graphs

Homework Statement:
So in my physics assignment we had to graph the negative of magnification (-M) versus distance between image and lens (q). From this we had to find the focal lengths from the intercepts. I have the focal length using the x intercept of the equation M=1-q/f (which I rearragened to -M= q/f -1) but I can’t figure out how to find the focal length using the y intercept.
Relevant Equations:
Y=mx+b is equivalent to -M=1/f•q -1
Focal point using x intercept: x0=-b/m=f
I tried -M=pq = f/(f-p) = f/f - f/p = 1-(f/p)
=> M+1= -f/p
=> -Mp-p=f

But since it’s the y intercept, p will equal zero and so the focal length will be 0?