# Plotting positive function … looks like it goes negative

I recently answered a question on the stats SE site which involved a $$\text{Sinc}^2$$ distribution with pdf:

f = (Sin[x]^2)/(Pi x^2)


... defined on the real line. Plotting it with code such as:

Plot[f, {x, -15, 15}, PlotRange -> All, AxesLabel -> {"x", "f"}]


yields:

(source: tri.org.au)

Another user commented that the plot seems to have a visual aberration ... it appears as though the pdf becomes negative each time it hits the $$x$$-axis (which it cannot actually do). Perhaps this is because the plotted curve is thicker than $$x$$-axis curve --- using PlotStyle -> Thin seems to alleviate the problem. On the other hand, the problem becomes worse if I generate the picture, and then re-size it to be smaller, or use say ImageSize -> 300.

I am wondering to what extent this is a visual aberration or a Mma plotting aberration? Is Mma actually plotting the curve below the axis - because that is how it appears?

• It's visual - a combination of the interpolation and thickness of the line. When I have a plot where this artifact happens and it bugs me, I just add an appropriately tiny y offset to the function. – ciao Jun 7 '16 at 5:33
• Does AxesStyle -> Thick satisfy you? – thedude Jun 7 '16 at 5:36
• Go with Frame->True – user9660 Jun 7 '16 at 5:46
• I am using MMA 10.4.0 on Win7-64, and my system produces a graph that just seems to be touching the horizontal axis, rather than going past it towards negative values (example). Perhaps this behavior is version / OS / graphics dependent. – MarcoB Jun 7 '16 at 16:02
• I am also not seeing this behavior on Win7-64 with MMa 10.4.1. BTW is there a reason for not using something like Sinc2Distribution = ProbabilityDistribution[ f[x], {x, -Infinity, Infinity}] and then using PDF[Sinc2Distribution][x] within the Plot? – gwr Jun 28 '16 at 11:32

If I force the axes to cross at the origin with AxesOrigin -> {0, 0}, I see only the expected tangencies:
Plot[Sinc[x]^2/π, {x, -15, 15}, AxesOrigin -> {0, 0}, PlotRange -> All]