When running the command:
Plot[1/x, {x, 0, 10}]
I get very weird output:

Not only that, but when running
Plot[1/x, {x, 0, 1000}, Mesh -> All]
Which should mark the points it generated the lines between, gives me this:

Please note that its 1000 here – not 10.
After reading Mathematica’s explanation about Plot – it says that it generates more points if the function changes fast. The function 1/x is changing very slow – and I though that Mathematica isn’t generation enough points – but using Mesh -> All I showed that it is incorrect.
Did anyone encounter this weird behavior? Can anyone please explain to me what causes this, and how can it be fixed?
P.S: This isn’t the only function which gives bad output – its actually quite common.
P.P.S: I tried playing with MaxRecursion and WorkingPresicion – and it did not help.
Edit: I’ve just notices that the X axis isn’t 0 – if you look at the first graph, you will see 0.4 as the last number, and 0.6 above it. The X axis is actually 0.2! So maybe the question is: why is the X axis at 0.2 and not 0?
I don’t see any weirdness in your first plot, I see the graph of a hyperbola. Mathematica has even been kind enough to you to ignore your attempt to evaluate
1/0.In your second plot, I think that you are expecting Mathematica to draw 1000 points along the line it plots ? How many pixels have you given it in which to draw those 1000 points in the x-direction ? I think that what you are seeing is an artefact common to most computer-based drawings: ask for 1000 points across (perhaps) 250 pixels and something’s got to give. Or perhaps I don’t understand why you are concerned about the output.
Finally, you ask: why is the X axis at 0.2 and not 0
The answer is that Mathematica has decided that the graph will look good that way. If you want to force the x-axis to cross the y-axis at 0, use the
AxesOriginoption in yourPlotcommand.